mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 22:21:23 +12:00
Only show valid hotkeys
This commit is contained in:
parent
29906f52ae
commit
4fc9c13dd4
|
@ -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;
|
private bool drawBorder;
|
||||||
|
|
||||||
[DefaultValue(false)]
|
[DefaultValue(false)]
|
||||||
|
@ -93,14 +109,10 @@ public BlackStyleLabel()
|
||||||
DoubleBuffered = true;
|
DoubleBuffered = true;
|
||||||
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
|
SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
|
||||||
|
|
||||||
Prepare();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Prepare()
|
|
||||||
{
|
|
||||||
TextAlign = ContentAlignment.TopLeft;
|
TextAlign = ContentAlignment.TopLeft;
|
||||||
BackColor = Color.Transparent;
|
BackColor = Color.Transparent;
|
||||||
ForeColor = Color.White;
|
ForeColor = Color.White;
|
||||||
|
TextShadowColor = Color.Black;
|
||||||
Font = new Font("Arial", 12);
|
Font = new Font("Arial", 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +167,7 @@ private void DrawText(Graphics g)
|
||||||
break;
|
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);
|
TextRenderer.DrawText(g, Text, Font, ClientRectangle, ForeColor, tff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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))]
|
[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; }
|
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; }
|
public bool ShowMainWindowTip { get; set; }
|
||||||
|
|
||||||
[Category("Application / Config"), DefaultValue(false), Description("Automatically detect external changes to UploaderConfig file and load settigns to memory.")]
|
[Category("Application / Config"), DefaultValue(false), Description("Automatically detect external changes to UploaderConfig file and load settigns to memory.")]
|
||||||
|
|
|
@ -208,7 +208,7 @@ private void UpdateMainFormTip()
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
sb.AppendLine("Currently configured hotkeys:");
|
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);
|
sb.AppendFormat("{0} | {1}\r\n", hotkey.HotkeyInfo, hotkey.TaskSettings.Description);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue