mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add plugin hotkey type
This commit is contained in:
parent
698fe79265
commit
7d0cf1fb7a
2 changed files with 20 additions and 2 deletions
|
|
@ -110,7 +110,10 @@ namespace Flow.Launcher
|
|||
SelectPrevItemHotkey,
|
||||
SelectPrevItemHotkey2,
|
||||
SelectNextItemHotkey,
|
||||
SelectNextItemHotkey2
|
||||
SelectNextItemHotkey2,
|
||||
// Plugin hotkeys
|
||||
GlobalPluginHotkey,
|
||||
WindowPluginHotkey,
|
||||
}
|
||||
|
||||
// We can initialize settings in static field because it has been constructed in App constuctor
|
||||
|
|
@ -142,6 +145,9 @@ namespace Flow.Launcher
|
|||
HotkeyType.SelectPrevItemHotkey2 => _settings.SelectPrevItemHotkey2,
|
||||
HotkeyType.SelectNextItemHotkey => _settings.SelectNextItemHotkey,
|
||||
HotkeyType.SelectNextItemHotkey2 => _settings.SelectNextItemHotkey2,
|
||||
// Plugin hotkeys
|
||||
HotkeyType.GlobalPluginHotkey => hotkey,
|
||||
HotkeyType.WindowPluginHotkey => hotkey,
|
||||
_ => throw new System.NotImplementedException("Hotkey type not set")
|
||||
};
|
||||
}
|
||||
|
|
@ -201,6 +207,17 @@ namespace Flow.Launcher
|
|||
case HotkeyType.SelectNextItemHotkey2:
|
||||
_settings.SelectNextItemHotkey2 = value;
|
||||
break;
|
||||
// Plugin hotkeys
|
||||
case HotkeyType.GlobalPluginHotkey:
|
||||
// We should not save it to settings here because it is a custom plugin hotkey
|
||||
// and it will be saved in the plugin settings
|
||||
hotkey = value;
|
||||
break;
|
||||
case HotkeyType.WindowPluginHotkey:
|
||||
// We should not save it to settings here because it is a custom plugin hotkey
|
||||
// and it will be saved in the plugin settings
|
||||
hotkey = value;
|
||||
break;
|
||||
default:
|
||||
throw new System.NotImplementedException("Hotkey type not set");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,8 @@ public partial class SettingsPaneHotkey
|
|||
{
|
||||
var hotkeyControl = new HotkeyControl
|
||||
{
|
||||
Type = HotkeyControl.HotkeyType.CustomQueryHotkey,
|
||||
Type = hotkey.HotkeyType == HotkeyType.Global ?
|
||||
HotkeyControl.HotkeyType.GlobalPluginHotkey : HotkeyControl.HotkeyType.WindowPluginHotkey,
|
||||
DefaultHotkey = hotkey.DefaultHotkey,
|
||||
ValidateKeyGesture = true
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue