Skip to content

Commit

Permalink
Add icon for keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Feb 2, 2025
1 parent 72d2b23 commit e5cecb3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NAPS2.Lib/EtoForms/Ui/KeyboardShortcutsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ public KeyboardShortcutsForm(Naps2Config config, KeyboardShortcutManager ksm,

protected override void BuildLayout()
{
FormStateController.RestoreFormState = false;
Title = UiStrings.KeyboardShortcutsFormTitle;
IconName = "keyboard_small";

LayoutController.Content = L.Column(
L.Row(
Expand Down
5 changes: 3 additions & 2 deletions NAPS2.Lib/EtoForms/Ui/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public SettingsForm(Naps2Config config, DesktopSubFormController desktopSubFormC
};
_keyboardShortcutsCommand = new ActionCommand(() => FormFactory.Create<KeyboardShortcutsForm>().ShowModal())
{
Text = UiStrings.KeyboardShortcuts
Text = UiStrings.KeyboardShortcuts,
Image = iconProvider.GetIcon("keyboard_small")
};
}

Expand Down Expand Up @@ -80,7 +81,7 @@ protected override void BuildLayout()
).Aligned()
: C.None(),
PlatformCompat.System.SupportsKeyboardShortcuts
? C.Button(_keyboardShortcutsCommand).AlignLeading()
? C.Button(_keyboardShortcutsCommand, ButtonImagePosition.Left).AlignLeading()
: C.None()
)
),
Expand Down
20 changes: 20 additions & 0 deletions NAPS2.Lib/Icons.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions NAPS2.Lib/Icons.resx
Original file line number Diff line number Diff line change
Expand Up @@ -664,4 +664,10 @@
<data name="application_side_list_small" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\application_side_list-small.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="keyboard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\keyboard.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="keyboard_small" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>Icons\keyboard-small.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
Binary file added NAPS2.Lib/Icons/keyboard-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added NAPS2.Lib/Icons/keyboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e5cecb3

Please sign in to comment.