Skip to content

Commit 83c7ee1

Browse files
committed
Change type name & Add comments
1 parent 0f3f97a commit 83c7ee1

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Flow.Launcher/CustomQueryHotkeySetting.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
VerticalAlignment="Center"
105105
HorizontalContentAlignment="Left"
106106
DefaultHotkey=""
107-
Type="None" />
107+
Type="CustomQueryHotkey" />
108108
<TextBlock
109109
Grid.Row="1"
110110
Grid.Column="0"

Flow.Launcher/HotkeyControl.xaml.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public ICommand? ChangeHotkey
8484
nameof(Type),
8585
typeof(HotkeyType),
8686
typeof(HotkeyControl),
87-
new FrameworkPropertyMetadata(HotkeyType.None, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnHotkeyChanged)
87+
new FrameworkPropertyMetadata(HotkeyType.CustomQueryHotkey, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnHotkeyChanged)
8888
);
8989

9090
public HotkeyType Type
@@ -95,8 +95,8 @@ public HotkeyType Type
9595

9696
public enum HotkeyType
9797
{
98-
// Custom hotkeys
99-
None, // Used for getting hotkey from dialog result
98+
// Custom query hotkeys
99+
CustomQueryHotkey,
100100
// Settings hotkeys
101101
Hotkey,
102102
PreviewHotkey,
@@ -125,8 +125,8 @@ public string Hotkey
125125
{
126126
return Type switch
127127
{
128-
// Custom hotkeys
129-
HotkeyType.None => hotkey,
128+
// Custom query hotkeys
129+
HotkeyType.CustomQueryHotkey => hotkey,
130130
// Settings hotkeys
131131
HotkeyType.Hotkey => _settings.Hotkey,
132132
HotkeyType.PreviewHotkey => _settings.PreviewHotkey,
@@ -149,8 +149,10 @@ public string Hotkey
149149
{
150150
switch (Type)
151151
{
152-
// Custom hotkeys
153-
case HotkeyType.None:
152+
// Custom query hotkeys
153+
case HotkeyType.CustomQueryHotkey:
154+
// We just need to store it in a local field
155+
// because we will save to settings in other place
154156
hotkey = value;
155157
break;
156158
// Settings hotkeys

0 commit comments

Comments
 (0)