mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add OpenHistory hotkey functionality and binding
This commit is contained in:
parent
6144d4a3a4
commit
05486eae26
5 changed files with 20 additions and 6 deletions
|
|
@ -50,6 +50,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public string SelectPrevPageHotkey { get; set; } = $"PageDown";
|
||||
public string OpenContextMenuHotkey { get; set; } = $"Ctrl+O";
|
||||
public string SettingWindowHotkey { get; set; } = $"Ctrl+I";
|
||||
public string OpenHistoryHotkey { get; set; } = $"Ctrl+H";
|
||||
public string CycleHistoryUpHotkey { get; set; } = $"{KeyConstant.Alt} + Up";
|
||||
public string CycleHistoryDownHotkey { get; set; } = $"{KeyConstant.Alt} + Down";
|
||||
|
||||
|
|
@ -426,6 +427,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
list.Add(new(SelectPrevItemHotkey2, "SelectPrevItemHotkey", () => SelectPrevItemHotkey2 = ""));
|
||||
if (!string.IsNullOrEmpty(SettingWindowHotkey))
|
||||
list.Add(new(SettingWindowHotkey, "SettingWindowHotkey", () => SettingWindowHotkey = ""));
|
||||
if (!string.IsNullOrEmpty(OpenHistoryHotkey))
|
||||
list.Add(new(OpenHistoryHotkey, "OpenHistoryHotkey", () => OpenHistoryHotkey = ""));
|
||||
if (!string.IsNullOrEmpty(OpenContextMenuHotkey))
|
||||
list.Add(new(OpenContextMenuHotkey, "OpenContextMenuHotkey", () => OpenContextMenuHotkey = ""));
|
||||
if (!string.IsNullOrEmpty(SelectNextPageHotkey))
|
||||
|
|
@ -461,7 +464,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
new("Alt+Home", "HotkeySelectFirstResult"),
|
||||
new("Alt+End", "HotkeySelectLastResult"),
|
||||
new("Ctrl+R", "HotkeyRequery"),
|
||||
new("Ctrl+H", "ToggleHistoryHotkey"),
|
||||
new("Ctrl+OemCloseBrackets", "QuickWidthHotkey"),
|
||||
new("Ctrl+OemOpenBrackets", "QuickWidthHotkey"),
|
||||
new("Ctrl+OemPlus", "QuickHeightHotkey"),
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ namespace Flow.Launcher
|
|||
PreviewHotkey,
|
||||
OpenContextMenuHotkey,
|
||||
SettingWindowHotkey,
|
||||
OpenHistoryHotkey,
|
||||
CycleHistoryUpHotkey,
|
||||
CycleHistoryDownHotkey,
|
||||
SelectPrevPageHotkey,
|
||||
|
|
@ -130,6 +131,7 @@ namespace Flow.Launcher
|
|||
HotkeyType.PreviewHotkey => _settings.PreviewHotkey,
|
||||
HotkeyType.OpenContextMenuHotkey => _settings.OpenContextMenuHotkey,
|
||||
HotkeyType.SettingWindowHotkey => _settings.SettingWindowHotkey,
|
||||
HotkeyType.OpenHistoryHotkey => _settings.OpenHistoryHotkey,
|
||||
HotkeyType.CycleHistoryUpHotkey => _settings.CycleHistoryUpHotkey,
|
||||
HotkeyType.CycleHistoryDownHotkey => _settings.CycleHistoryDownHotkey,
|
||||
HotkeyType.SelectPrevPageHotkey => _settings.SelectPrevPageHotkey,
|
||||
|
|
@ -166,6 +168,9 @@ namespace Flow.Launcher
|
|||
case HotkeyType.SettingWindowHotkey:
|
||||
_settings.SettingWindowHotkey = value;
|
||||
break;
|
||||
case HotkeyType.OpenHistoryHotkey:
|
||||
_settings.OpenHistoryHotkey = value;
|
||||
break;
|
||||
case HotkeyType.CycleHistoryUpHotkey:
|
||||
_settings.CycleHistoryUpHotkey = value;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -64,10 +64,6 @@
|
|||
Key="R"
|
||||
Command="{Binding ReQueryCommand}"
|
||||
Modifiers="Ctrl" />
|
||||
<KeyBinding
|
||||
Key="H"
|
||||
Command="{Binding LoadHistoryCommand}"
|
||||
Modifiers="Ctrl" />
|
||||
<KeyBinding
|
||||
Key="OemCloseBrackets"
|
||||
Command="{Binding IncreaseWidthCommand}"
|
||||
|
|
@ -191,6 +187,10 @@
|
|||
Key="{Binding SettingWindowHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
|
||||
Command="{Binding OpenSettingCommand}"
|
||||
Modifiers="{Binding SettingWindowHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
|
||||
<KeyBinding
|
||||
Key="{Binding OpenHistoryHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
|
||||
Command="{Binding LoadHistoryCommand}"
|
||||
Modifiers="{Binding OpenHistoryHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
|
||||
<KeyBinding
|
||||
Key="{Binding OpenContextMenuHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
|
||||
Command="{Binding LoadContextMenuCommand}"
|
||||
|
|
|
|||
|
|
@ -89,7 +89,10 @@
|
|||
Title="{DynamicResource ToggleHistoryHotkey}"
|
||||
Icon=""
|
||||
Type="Inside">
|
||||
<cc:HotkeyDisplay Keys="Ctrl+H" />
|
||||
<flowlauncher:HotkeyControl
|
||||
DefaultHotkey="Ctrl+H"
|
||||
Type="OpenHistoryHotkey"
|
||||
ValidateKeyGesture="False" />
|
||||
</cc:Card>
|
||||
<cc:Card
|
||||
Title="{DynamicResource CopyFilePathHotkey}"
|
||||
|
|
|
|||
|
|
@ -137,6 +137,9 @@ namespace Flow.Launcher.ViewModel
|
|||
case nameof(Settings.SettingWindowHotkey):
|
||||
OnPropertyChanged(nameof(SettingWindowHotkey));
|
||||
break;
|
||||
case nameof(Settings.OpenHistoryHotkey):
|
||||
OnPropertyChanged(nameof(OpenHistoryHotkey));
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -886,6 +889,7 @@ namespace Flow.Launcher.ViewModel
|
|||
public string SelectPrevPageHotkey => VerifyOrSetDefaultHotkey(Settings.SelectPrevPageHotkey, "");
|
||||
public string OpenContextMenuHotkey => VerifyOrSetDefaultHotkey(Settings.OpenContextMenuHotkey, "Ctrl+O");
|
||||
public string SettingWindowHotkey => VerifyOrSetDefaultHotkey(Settings.SettingWindowHotkey, "Ctrl+I");
|
||||
public string OpenHistoryHotkey => VerifyOrSetDefaultHotkey(Settings.OpenHistoryHotkey, "Ctrl+H");
|
||||
public string CycleHistoryUpHotkey => VerifyOrSetDefaultHotkey(Settings.CycleHistoryUpHotkey, "Alt+Up");
|
||||
public string CycleHistoryDownHotkey => VerifyOrSetDefaultHotkey(Settings.CycleHistoryDownHotkey, "Alt+Down");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue