mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Apply dark theme to contextmenustrip
This commit is contained in:
parent
17b6c009fe
commit
5ad065460c
7 changed files with 21 additions and 26 deletions
|
@ -46,7 +46,6 @@ public static string UserAgent
|
|||
public static bool ExperimentalDarkTheme { get; set; } = true;
|
||||
|
||||
public static Icon Icon => UseWhiteIcon ? Resources.ShareX_Icon_White : Resources.ShareX_Icon;
|
||||
|
||||
public static Image Logo => Resources.ShareX_Logo;
|
||||
public static Image LogoBlack => Resources.ShareX_Logo_Black;
|
||||
|
||||
|
@ -55,6 +54,7 @@ public static string UserAgent
|
|||
public static Color BorderColor => UseDarkTheme ? DarkBorderColor : ProfessionalColors.SeparatorDark;
|
||||
public static Color CheckerColor1 => UseDarkTheme ? DarkCheckerColor1 : SystemColors.ControlLightLight;
|
||||
public static Color CheckerColor2 => UseDarkTheme ? DarkCheckerColor2 : SystemColors.ControlLight;
|
||||
public static int CheckerSize { get; } = 15;
|
||||
|
||||
public static Color DarkBackgroundColor { get; } = Color.FromArgb(42, 47, 56);
|
||||
public static Color DarkTextColor { get; } = Color.FromArgb(235, 235, 235);
|
||||
|
@ -63,8 +63,6 @@ public static string UserAgent
|
|||
public static Color DarkCheckerColor2 { get; } = Color.FromArgb(50, 50, 50);
|
||||
public static Color DarkLinkColor { get; } = Color.FromArgb(166, 212, 255);
|
||||
|
||||
public static int CheckerSize { get; } = 15;
|
||||
|
||||
public static void ApplyTheme(Form form, bool setIcon = true)
|
||||
{
|
||||
if (setIcon)
|
||||
|
@ -89,6 +87,16 @@ public static void ApplyTheme(Form form, bool setIcon = true)
|
|||
|
||||
private static void ApplyDarkThemeToControl(Control control)
|
||||
{
|
||||
if (control.ContextMenuStrip != null)
|
||||
{
|
||||
control.ContextMenuStrip.Renderer = new ToolStripDarkRenderer();
|
||||
}
|
||||
|
||||
if (control is MenuButton mb && mb.Menu != null)
|
||||
{
|
||||
mb.Menu.Renderer = new ToolStripDarkRenderer();
|
||||
}
|
||||
|
||||
switch (control)
|
||||
{
|
||||
case Button btn:
|
||||
|
|
1
ShareX.HistoryLib/Forms/HistoryForm.Designer.cs
generated
1
ShareX.HistoryLib/Forms/HistoryForm.Designer.cs
generated
|
@ -116,7 +116,6 @@ private void InitializeComponent()
|
|||
this.lvHistory.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.lvHistory_ItemSelectionChanged);
|
||||
this.lvHistory.KeyDown += new System.Windows.Forms.KeyEventHandler(this.lvHistory_KeyDown);
|
||||
this.lvHistory.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.lvHistory_MouseDoubleClick);
|
||||
this.lvHistory.MouseUp += new System.Windows.Forms.MouseEventHandler(this.lvHistory_MouseUp);
|
||||
//
|
||||
// chIcon
|
||||
//
|
||||
|
|
|
@ -52,7 +52,6 @@ public HistoryForm(string historyPath, HistorySettings settings, Action<string>
|
|||
Settings = settings;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
|
||||
defaultTitle = Text;
|
||||
UpdateTitle();
|
||||
|
@ -70,6 +69,7 @@ public HistoryForm(string historyPath, HistorySettings settings, Action<string>
|
|||
|
||||
him = new HistoryItemManager(uploadFile, editImage);
|
||||
him.GetHistoryItems += him_GetHistoryItems;
|
||||
lvHistory.ContextMenuStrip = him.cmsHistory;
|
||||
|
||||
pbThumbnail.Reset();
|
||||
lvHistory.FillLastColumn();
|
||||
|
@ -79,6 +79,8 @@ public HistoryForm(string historyPath, HistorySettings settings, Action<string>
|
|||
scMain.SplitterDistance = Settings.SplitterDistance;
|
||||
}
|
||||
|
||||
ShareXResources.ApplyTheme(this);
|
||||
|
||||
Settings.WindowState.AutoHandleFormState(this);
|
||||
}
|
||||
|
||||
|
@ -427,14 +429,6 @@ private void lvHistory_ItemSelectionChanged(object sender, ListViewItemSelection
|
|||
}
|
||||
}
|
||||
|
||||
private void lvHistory_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
him.cmsHistory.Show(lvHistory, e.X + 1, e.Y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void lvHistory_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (him != null && e.Button == MouseButtons.Left)
|
||||
|
|
|
@ -286,7 +286,7 @@
|
|||
<value>8, 8</value>
|
||||
</data>
|
||||
<data name="pbThumbnail.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>408, 352</value>
|
||||
<value>406, 352</value>
|
||||
</data>
|
||||
<data name="pbThumbnail.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
|
@ -700,7 +700,7 @@
|
|||
<value>8, 368</value>
|
||||
</data>
|
||||
<data name="gbFilters.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>408, 234</value>
|
||||
<value>406, 234</value>
|
||||
</data>
|
||||
<data name="gbFilters.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>4</value>
|
||||
|
|
|
@ -78,7 +78,6 @@ private void InitializeComponent()
|
|||
this.ilvImages.ItemDoubleClick += new Manina.Windows.Forms.ItemDoubleClickEventHandler(this.ilvImages_ItemDoubleClick);
|
||||
this.ilvImages.SelectionChanged += new System.EventHandler(this.ilvImages_SelectionChanged);
|
||||
this.ilvImages.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ilvImages_KeyDown);
|
||||
this.ilvImages.MouseUp += new System.Windows.Forms.MouseEventHandler(this.ilvImages_MouseUp);
|
||||
//
|
||||
// tsMain
|
||||
//
|
||||
|
|
|
@ -49,7 +49,6 @@ public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Actio
|
|||
{
|
||||
InitializeComponent();
|
||||
tsMain.Renderer = new ToolStripRoundedEdgeRenderer();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
|
||||
HistoryPath = historyPath;
|
||||
Settings = settings;
|
||||
|
@ -59,6 +58,7 @@ public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Actio
|
|||
|
||||
him = new HistoryItemManager(uploadFile, editImage);
|
||||
him.GetHistoryItems += him_GetHistoryItems;
|
||||
ilvImages.ContextMenuStrip = him.cmsHistory;
|
||||
|
||||
defaultTitle = Text;
|
||||
|
||||
|
@ -67,6 +67,8 @@ public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Actio
|
|||
tstbSearch.Text = Settings.SearchText;
|
||||
}
|
||||
|
||||
ShareXResources.ApplyTheme(this);
|
||||
|
||||
Settings.WindowState.AutoHandleFormState(this);
|
||||
}
|
||||
|
||||
|
@ -161,14 +163,6 @@ private void ImageHistoryForm_KeyDown(object sender, KeyEventArgs e)
|
|||
}
|
||||
}
|
||||
|
||||
private void ilvImages_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Right)
|
||||
{
|
||||
him.cmsHistory.Show(ilvImages, e.X + 1, e.Y + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void ilvImages_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
him.RefreshInfo();
|
||||
|
|
|
@ -59,7 +59,6 @@ public CustomUploaderSettingsForm(UploadersConfig config)
|
|||
Config = config;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
|
||||
/*
|
||||
CodeMenuItem[] inputCodeMenuItems = new CodeMenuItem[]
|
||||
|
@ -105,6 +104,8 @@ public CustomUploaderSettingsForm(UploadersConfig config)
|
|||
cbRequestMethod.Items.AddRange(Enum.GetNames(typeof(HttpMethod)));
|
||||
cbBody.Items.AddRange(Helpers.GetEnumDescriptions<CustomUploaderBody>());
|
||||
|
||||
ShareXResources.ApplyTheme(this);
|
||||
|
||||
CustomUploaderLoadTab();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue