From 4fc9c13dd408ae4b154699a9ca167a0ae0e601ef Mon Sep 17 00:00:00 2001 From: Jaex Date: Mon, 24 Nov 2014 01:09:16 +0200 Subject: [PATCH] Only show valid hotkeys --- .../Controls/BlackStyle/BlackStyleLabel.cs | 24 ++++++++++++++----- ShareX/ApplicationConfig.cs | 2 +- ShareX/Forms/MainForm.cs | 2 +- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/HelpersLib/Controls/BlackStyle/BlackStyleLabel.cs b/HelpersLib/Controls/BlackStyle/BlackStyleLabel.cs index 443e677a9..7eef5c9af 100644 --- a/HelpersLib/Controls/BlackStyle/BlackStyleLabel.cs +++ b/HelpersLib/Controls/BlackStyle/BlackStyleLabel.cs @@ -70,6 +70,22 @@ public ContentAlignment TextAlign } } + private Color textShadowColor; + + [DefaultValue(typeof(Color), "Black")] + public Color TextShadowColor + { + get + { + return textShadowColor; + } + set + { + textShadowColor = value; + Refresh(); + } + } + private bool drawBorder; [DefaultValue(false)] @@ -93,14 +109,10 @@ public BlackStyleLabel() DoubleBuffered = true; SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true); - Prepare(); - } - - private void Prepare() - { TextAlign = ContentAlignment.TopLeft; BackColor = Color.Transparent; ForeColor = Color.White; + TextShadowColor = Color.Black; Font = new Font("Arial", 12); } @@ -155,7 +167,7 @@ private void DrawText(Graphics g) break; } - TextRenderer.DrawText(g, Text, Font, new Rectangle(ClientRectangle.X, ClientRectangle.Y + 1, ClientRectangle.Width, ClientRectangle.Height + 1), Color.Black, tff); + TextRenderer.DrawText(g, Text, Font, new Rectangle(ClientRectangle.X, ClientRectangle.Y + 1, ClientRectangle.Width, ClientRectangle.Height + 1), TextShadowColor, tff); TextRenderer.DrawText(g, Text, Font, ClientRectangle, ForeColor, tff); } diff --git a/ShareX/ApplicationConfig.cs b/ShareX/ApplicationConfig.cs index d2febe9b9..b96aa1a04 100644 --- a/ShareX/ApplicationConfig.cs +++ b/ShareX/ApplicationConfig.cs @@ -134,7 +134,7 @@ public ApplicationConfig() [Category("Application"), DefaultValue(HotkeyType.RectangleRegion), Description("You can set which action to happen when you middle click tray icon."), TypeConverter(typeof(EnumDescriptionConverter))] public HotkeyType TrayMiddleClickAction { get; set; } - [Category("Application"), DefaultValue(true), Description("Shows tips in main window list field when task list is empty.")] + [Category("Application"), DefaultValue(true), Description("Show tips in main window list when list is empty.")] public bool ShowMainWindowTip { get; set; } [Category("Application / Config"), DefaultValue(false), Description("Automatically detect external changes to UploaderConfig file and load settigns to memory.")] diff --git a/ShareX/Forms/MainForm.cs b/ShareX/Forms/MainForm.cs index ea388818c..4dc69ee5c 100644 --- a/ShareX/Forms/MainForm.cs +++ b/ShareX/Forms/MainForm.cs @@ -208,7 +208,7 @@ private void UpdateMainFormTip() sb.AppendLine(); sb.AppendLine("Currently configured hotkeys:"); - foreach (HotkeySettings hotkey in Program.HotkeysConfig.Hotkeys) + foreach (HotkeySettings hotkey in Program.HotkeysConfig.Hotkeys.Where(x => x.HotkeyInfo.IsValidHotkey)) { sb.AppendFormat("{0} | {1}\r\n", hotkey.HotkeyInfo, hotkey.TaskSettings.Description); }