diff --git a/ShareX.HelpersLib/ShareXResources.cs b/ShareX.HelpersLib/ShareXResources.cs index 8c5df92d4..5d335131c 100644 --- a/ShareX.HelpersLib/ShareXResources.cs +++ b/ShareX.HelpersLib/ShareXResources.cs @@ -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: diff --git a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs index f86c4988d..c63eabb04 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.Designer.cs @@ -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 // diff --git a/ShareX.HistoryLib/Forms/HistoryForm.cs b/ShareX.HistoryLib/Forms/HistoryForm.cs index 903b89b24..1558df161 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.cs +++ b/ShareX.HistoryLib/Forms/HistoryForm.cs @@ -52,7 +52,6 @@ public HistoryForm(string historyPath, HistorySettings settings, Action Settings = settings; InitializeComponent(); - ShareXResources.ApplyTheme(this); defaultTitle = Text; UpdateTitle(); @@ -70,6 +69,7 @@ public HistoryForm(string historyPath, HistorySettings settings, Action 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 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) diff --git a/ShareX.HistoryLib/Forms/HistoryForm.resx b/ShareX.HistoryLib/Forms/HistoryForm.resx index 3dffb31b4..cb144049c 100644 --- a/ShareX.HistoryLib/Forms/HistoryForm.resx +++ b/ShareX.HistoryLib/Forms/HistoryForm.resx @@ -286,7 +286,7 @@ 8, 8 - 408, 352 + 406, 352 3 @@ -700,7 +700,7 @@ 8, 368 - 408, 234 + 406, 234 4 diff --git a/ShareX.HistoryLib/Forms/ImageHistoryForm.Designer.cs b/ShareX.HistoryLib/Forms/ImageHistoryForm.Designer.cs index b3004e2de..9c38c6920 100644 --- a/ShareX.HistoryLib/Forms/ImageHistoryForm.Designer.cs +++ b/ShareX.HistoryLib/Forms/ImageHistoryForm.Designer.cs @@ -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 // diff --git a/ShareX.HistoryLib/Forms/ImageHistoryForm.cs b/ShareX.HistoryLib/Forms/ImageHistoryForm.cs index 011f543ac..2b99aeea2 100644 --- a/ShareX.HistoryLib/Forms/ImageHistoryForm.cs +++ b/ShareX.HistoryLib/Forms/ImageHistoryForm.cs @@ -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(); diff --git a/ShareX.UploadersLib/Forms/CustomUploaderSettingsForm.cs b/ShareX.UploadersLib/Forms/CustomUploaderSettingsForm.cs index 1d549b6f7..02276561c 100644 --- a/ShareX.UploadersLib/Forms/CustomUploaderSettingsForm.cs +++ b/ShareX.UploadersLib/Forms/CustomUploaderSettingsForm.cs @@ -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()); + ShareXResources.ApplyTheme(this); + CustomUploaderLoadTab(); }