Nearly all forms supports dark theme now

This commit is contained in:
Jaex 2019-06-23 18:10:51 +03:00
parent f57d9693a3
commit f43c631799
27 changed files with 59 additions and 39 deletions

View file

@ -88,6 +88,7 @@ private static void ApplyThemeToControl(Control control)
switch (control)
{
case Button btn:
case CheckBox cb when cb.Appearance == Appearance.Button:
// Button looks better with system colors
control.ForeColor = SystemColors.ControlText;
break;

View file

@ -33,7 +33,8 @@ public partial class HistoryItemInfoForm : Form
public HistoryItemInfoForm(object hi)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
olvMain.SelectObject(hi);
}
}

View file

@ -48,7 +48,7 @@ public partial class ImageHistoryForm : Form
public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Action<string> uploadFile = null, Action<string> editImage = null)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
HistoryPath = historyPath;
Settings = settings;

View file

@ -37,7 +37,7 @@ public partial class ImageHistorySettingsForm : Form
public ImageHistorySettingsForm(ImageHistorySettings settings)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
Settings = settings;
cbViewMode.Items.AddRange(Enum.GetNames(typeof(Manina.Windows.Forms.View)));

View file

@ -42,7 +42,8 @@ public partial class DirectoryIndexerForm : Form
public DirectoryIndexerForm(IndexerSettings settings)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
Settings = settings;
pgSettings.SelectedObject = Settings;
}

View file

@ -41,8 +41,10 @@ public partial class ImageCombinerForm : Form
public ImageCombinerForm(ImageCombinerOptions options)
{
Options = options;
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
cbOrientation.Items.AddRange(Enum.GetNames(typeof(Orientation)));
cbOrientation.SelectedIndex = (int)Options.Orientation;
nudSpace.SetValue(Options.Space);

View file

@ -37,7 +37,7 @@ public partial class ImageThumbnailerForm : Form
public ImageThumbnailerForm()
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
}
private void UpdateEnabled()

View file

@ -44,8 +44,10 @@ public VideoThumbnailerForm(string ffmpegPath, VideoThumbnailOptions options)
{
FFmpegPath = ffmpegPath;
Options = options;
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
txtMediaPath.Text = Options.LastVideoPath ?? "";
pgOptions.SelectedObject = Options;
}

View file

@ -36,7 +36,7 @@ public partial class CanvasSizeForm : Form
public CanvasSizeForm()
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
}
public CanvasSizeForm(Padding canvas) : this()

View file

@ -40,9 +40,10 @@ public partial class EditorStartupForm : Form
public EditorStartupForm(RegionCaptureOptions options)
{
InitializeComponent();
Icon = ShareXResources.Icon;
Options = options;
InitializeComponent();
ShareXResources.ApplyThemeToForm(this);
}
private void LoadImageFile(string imageFilePath)

View file

@ -45,10 +45,11 @@ public partial class FFmpegOptionsForm : Form
public FFmpegOptionsForm(ScreencastOptions options)
{
InitializeComponent();
Icon = ShareXResources.Icon;
Options = options;
InitializeComponent();
ShareXResources.ApplyThemeToForm(this);
eiFFmpeg.ObjectType = typeof(FFmpegOptions);
cboVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegVideoCodec>());
cboAudioCodec.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegAudioCodec>());
@ -236,6 +237,7 @@ private void UpdateFFmpegPathUI()
}
txtFFmpegPath.BackColor = backColor;
txtFFmpegPath.ForeColor = SystemColors.ControlText;
#endif
}

View file

@ -36,7 +36,7 @@ public partial class ImageInsertForm : Form
public ImageInsertForm()
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
}
private void Close(ImageInsertMethod insertMethod)

View file

@ -41,7 +41,7 @@ public partial class ImageSizeForm : Form
public ImageSizeForm(Size size, ImageEditorInterpolationMode interpolationMode)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
ImageSize = size;
InterpolationMode = interpolationMode;

View file

@ -37,7 +37,7 @@ public partial class NewImageForm : Form
public NewImageForm(RegionCaptureOptions options)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
Options = options;

View file

@ -56,7 +56,7 @@ public ScrollingCaptureForm(ScrollingCaptureOptions options, RegionCaptureOption
RegionCaptureOptions = regionCaptureOptions;
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
cbScrollMethod.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<ScrollingCaptureScrollMethod>());
cbScrollMethod.SelectedIndex = (int)Options.ScrollMethod;

View file

@ -49,7 +49,8 @@ public StickerForm(List<StickerPackInfo> stickerPacks, int selectedStickerPack,
StickerSize = stickerSize;
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
tsMain.Renderer = new ToolStripRoundedEdgeRenderer();
tsnudSize.NumericUpDownControl.Minimum = 16;
tsnudSize.NumericUpDownControl.Maximum = 256;

View file

@ -39,7 +39,7 @@ public StickerPackForm(List<StickerPackInfo> stickers)
Stickers = stickers;
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
foreach (StickerPackInfo stickerPackInfo in Stickers)
{

View file

@ -43,7 +43,7 @@ internal partial class TextDrawingInputBox : Form
public TextDrawingInputBox(string text, TextDrawingOptions options, bool supportGradient)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
InputText = text;
Options = options;

View file

@ -59,7 +59,7 @@ public CustomUploaderSettingsForm(UploadersConfig config)
Config = config;
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
/*
CodeMenuItem[] inputCodeMenuItems = new CodeMenuItem[]

View file

@ -38,7 +38,7 @@ public partial class EmailForm : Form
public EmailForm()
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
}
public EmailForm(string toEmail, string subject, string body) : this()

View file

@ -23,8 +23,6 @@ You should have received a copy of the GNU General Public License
#endregion License Information (GPL v3)
// gpailler
using ShareX.HelpersLib;
using ShareX.UploadersLib.Properties;
using System;
@ -51,7 +49,7 @@ public string IssueId
public JiraUpload()
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
}
public JiraUpload(string issuePrefix, GetSummaryHandler getSummary) : this()

View file

@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="lblIssueId.Location" type="System.Drawing.Point, System.Drawing">
<value>19, 9</value>
<value>13, 9</value>
</data>
<data name="lblIssueId.Size" type="System.Drawing.Size, System.Drawing">
<value>47, 13</value>
@ -157,7 +157,7 @@
<value>72, 6</value>
</data>
<data name="txtIssueId.Size" type="System.Drawing.Size, System.Drawing">
<value>153, 20</value>
<value>152, 20</value>
</data>
<data name="txtIssueId.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
@ -184,7 +184,7 @@
<value>3, 16</value>
</data>
<data name="lblSummary.Size" type="System.Drawing.Size, System.Drawing">
<value>207, 41</value>
<value>210, 41</value>
</data>
<data name="lblSummary.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -204,11 +204,14 @@
<data name="btnUpload.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Bottom, Right</value>
</data>
<data name="btnUpload.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="btnUpload.Location" type="System.Drawing.Point, System.Drawing">
<value>147, 98</value>
<value>120, 98</value>
</data>
<data name="btnUpload.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
<value>104, 23</value>
</data>
<data name="btnUpload.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
@ -232,10 +235,10 @@
<value>Bottom, Left</value>
</data>
<data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
<value>18, 98</value>
<value>8, 98</value>
</data>
<data name="btnCancel.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 23</value>
<value>104, 23</value>
</data>
<data name="btnCancel.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@ -259,10 +262,10 @@
<value>Top, Bottom, Left, Right</value>
</data>
<data name="gpSummary.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 32</value>
<value>8, 32</value>
</data>
<data name="gpSummary.Size" type="System.Drawing.Size, System.Drawing">
<value>213, 60</value>
<value>216, 60</value>
</data>
<data name="gpSummary.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
@ -291,6 +294,9 @@
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>237, 127</value>
</data>
<data name="$this.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>

View file

@ -44,7 +44,7 @@ public partial class OCRSpaceForm : Form
public OCRSpaceForm(OCROptions ocrOptions)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
this.ocrOptions = ocrOptions;
cbLanguages.Items.AddRange(Helpers.GetEnumDescriptions<OCRSpaceLanguages>());

View file

@ -38,7 +38,6 @@ public partial class ParserSelectForm : Form
public ParserSelectForm(string[] texts)
{
InitializeComponent();
Icon = ShareXResources.Icon;
Texts = texts;
SelectedText = Texts[0];
@ -60,7 +59,8 @@ public ParserSelectForm(string[] texts)
Margin = new Padding(i < rowSize ? 5 : 0, i % rowSize == 0 ? 5 : 0, 5, 5),
Padding = new Padding(5),
Font = new Font(Font.FontFamily, 12),
Text = text
Text = text,
UseVisualStyleBackColor = true
};
button.Click += (sender, e) =>
@ -81,6 +81,8 @@ public ParserSelectForm(string[] texts)
}
ResumeLayout();
ShareXResources.ApplyThemeToForm(this);
}
private void ParserSelectForm_Shown(object sender, EventArgs e)

View file

@ -38,7 +38,8 @@ public partial class ResponseForm : Form
public ResponseForm(string response)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
Response = response;
txtSource.Text = Response;
}

View file

@ -97,7 +97,8 @@ public bool MediaMode
public TwitterTweetForm()
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
MediaMode = false;
}

View file

@ -40,7 +40,8 @@ public partial class UserPassBox : Form
public UserPassBox(string title, string userName, string password)
{
InitializeComponent();
Icon = ShareXResources.Icon;
ShareXResources.ApplyThemeToForm(this);
Text = title;
txtUserName.Text = userName;
txtPassword.Text = password;