Change hotkey status indicators

This commit is contained in:
Jaex 2022-07-31 19:11:52 +03:00
parent 33f21d8b33
commit d883f99b9a
10 changed files with 66 additions and 21 deletions

View file

@ -33,7 +33,7 @@ private void InitializeComponent()
this.btnEdit = new System.Windows.Forms.Button();
this.cmsTask = new System.Windows.Forms.ContextMenuStrip(this.components);
this.btnTask = new ShareX.HelpersLib.MenuButton();
this.btnHotkey = new ShareX.HelpersLib.ColorButton();
this.btnHotkey = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// btnEdit
@ -62,11 +62,8 @@ private void InitializeComponent()
// btnHotkey
//
resources.ApplyResources(this.btnHotkey, "btnHotkey");
this.btnHotkey.Color = System.Drawing.Color.Empty;
this.btnHotkey.ColorPickerOptions = null;
this.btnHotkey.ManualButtonClick = true;
this.btnHotkey.Image = global::ShareX.Properties.Resources.status_away;
this.btnHotkey.Name = "btnHotkey";
this.btnHotkey.Offset = 0;
this.btnHotkey.UseVisualStyleBackColor = true;
this.btnHotkey.KeyDown += new System.Windows.Forms.KeyEventHandler(this.btnHotkey_KeyDown);
this.btnHotkey.KeyUp += new System.Windows.Forms.KeyEventHandler(this.btnHotkey_KeyUp);
@ -78,18 +75,18 @@ private void InitializeComponent()
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.Controls.Add(this.btnHotkey);
this.Controls.Add(this.btnTask);
this.Controls.Add(this.btnEdit);
this.Controls.Add(this.btnHotkey);
this.Name = "HotkeySelectionControl";
this.ResumeLayout(false);
}
#endregion
private HelpersLib.ColorButton btnHotkey;
private System.Windows.Forms.Button btnEdit;
private HelpersLib.MenuButton btnTask;
private System.Windows.Forms.ContextMenuStrip cmsTask;
private System.Windows.Forms.Button btnHotkey;
}
}

View file

@ -180,13 +180,13 @@ public void UpdateHotkeyStatus()
{
default:
case HotkeyStatus.NotConfigured:
btnHotkey.Color = Color.LightGoldenrodYellow;
btnHotkey.Image = Resources.status_away;
break;
case HotkeyStatus.Failed:
btnHotkey.Color = Color.IndianRed;
btnHotkey.Image = Resources.status_busy;
break;
case HotkeyStatus.Registered:
btnHotkey.Color = Color.PaleGreen;
btnHotkey.Image = Resources.status;
break;
}
}

View file

@ -145,7 +145,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;btnEdit.ZOrder" xml:space="preserve">
<value>2</value>
<value>3</value>
</data>
<metadata name="cmsTask.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
@ -199,40 +199,40 @@
<value>$this</value>
</data>
<data name="&gt;&gt;btnTask.ZOrder" xml:space="preserve">
<value>1</value>
<value>2</value>
</data>
<data name="btnHotkey.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Right</value>
</data>
<data name="btnHotkey.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
<data name="btnHotkey.ImageAlign" type="System.Drawing.ContentAlignment, System.Drawing">
<value>MiddleRight</value>
</data>
<data name="btnHotkey.Location" type="System.Drawing.Point, System.Drawing">
<value>261, 0</value>
</data>
<data name="btnHotkey.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 0, 23, 0</value>
</data>
<data name="btnHotkey.Size" type="System.Drawing.Size, System.Drawing">
<value>219, 27</value>
</data>
<data name="btnHotkey.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
<value>3</value>
</data>
<data name="btnHotkey.Text" xml:space="preserve">
<value>Hotkey</value>
</data>
<data name="btnHotkey.TextImageRelation" type="System.Windows.Forms.TextImageRelation, System.Windows.Forms">
<value>TextBeforeImage</value>
</data>
<data name="&gt;&gt;btnHotkey.Name" xml:space="preserve">
<value>btnHotkey</value>
</data>
<data name="&gt;&gt;btnHotkey.Type" xml:space="preserve">
<value>ShareX.HelpersLib.ColorButton, ShareX.HelpersLib, Version=14.1.1.0, Culture=neutral, PublicKeyToken=null</value>
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;btnHotkey.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;btnHotkey.ZOrder" xml:space="preserve">
<value>3</value>
<value>1</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>

View file

@ -394,7 +394,7 @@
<value>607, 461</value>
</data>
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>623, 200</value>
<value>623, 300</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>

View file

@ -2522,6 +2522,36 @@ public class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap status {
get {
object obj = ResourceManager.GetObject("status", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap status_away {
get {
object obj = ResourceManager.GetObject("status_away", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap status_busy {
get {
object obj = ResourceManager.GetObject("status_busy", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to Switch to list view.
/// </summary>

View file

@ -1114,4 +1114,13 @@ Middle click to close</value>
<data name="PinToScreen" xml:space="preserve">
<value>Pin to screen</value>
</data>
<data name="status" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\status.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="status_away" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\status-away.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="status_busy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\status-busy.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

BIN
ShareX/Resources/status.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

View file

@ -2098,6 +2098,15 @@
<ItemGroup>
<None Include="Resources\pin.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\status-busy.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\status.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\status-away.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>