mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add Next/Prev Hotkey Item
This commit is contained in:
parent
c39da2f5f3
commit
e53e1a0222
6 changed files with 77 additions and 14 deletions
|
|
@ -20,7 +20,9 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public bool ShowOpenResultHotkey { get; set; } = true;
|
||||
public double WindowSize { get; set; } = 580;
|
||||
public string PreviewHotkey { get; set; } = $"F1";
|
||||
public string AutoCompleteHotkey { get; set; } = $"F2";
|
||||
public string AutoCompleteHotkey { get; set; } = $"{KeyConstant.Ctrl} + P";
|
||||
public string SelectNextItemHotkey { get; set; } = $"Tab";
|
||||
public string SelectPrevItemHotkey { get; set; } = $"Shift + Tab";
|
||||
|
||||
public string Language
|
||||
{
|
||||
|
|
|
|||
|
|
@ -180,6 +180,10 @@
|
|||
<system:String x:Key="openResultModifiersToolTip">Select a modifier key to open selected result via keyboard.</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Show Hotkey</system:String>
|
||||
<system:String x:Key="showOpenResultHotkeyToolTip">Show result selection hotkey with results.</system:String>
|
||||
<system:String x:Key="autoCompleteHotkey">Auto Complete Hotkey</system:String>
|
||||
<system:String x:Key="autoCompleteHotkeyToolTip">Runs autocomplete for the selected items.</system:String>
|
||||
<system:String x:Key="SelectNextItemHotkey">Next Item Hotkey</system:String>
|
||||
<system:String x:Key="SelectPrevItemHotkey">Prev Item Hotkey</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Custom Query Hotkeys</system:String>
|
||||
<system:String x:Key="customQueryShortcut">Custom Query Shortcuts</system:String>
|
||||
<system:String x:Key="builtinShortcuts">Built-in Shortcuts</system:String>
|
||||
|
|
|
|||
|
|
@ -46,18 +46,10 @@
|
|||
<Window.InputBindings>
|
||||
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
|
||||
<KeyBinding Key="F5" Command="{Binding ReloadPluginDataCommand}" />
|
||||
<KeyBinding
|
||||
Key="Tab"
|
||||
Command="{Binding AutocompleteQueryCommand}"
|
||||
Modifiers="Shift" />
|
||||
<KeyBinding
|
||||
Key="I"
|
||||
Command="{Binding OpenSettingCommand}"
|
||||
Modifiers="Ctrl" />
|
||||
<KeyBinding
|
||||
Key="N"
|
||||
Command="{Binding SelectNextItemCommand}"
|
||||
Modifiers="Ctrl" />
|
||||
<KeyBinding
|
||||
Key="J"
|
||||
Command="{Binding SelectNextItemCommand}"
|
||||
|
|
@ -197,6 +189,14 @@
|
|||
Key="{Binding AutoCompleteHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
|
||||
Command="{Binding AutocompleteQueryCommand}"
|
||||
Modifiers="{Binding AutoCompleteHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
|
||||
<KeyBinding
|
||||
Key="{Binding SelectNextItemHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
|
||||
Command="{Binding SelectNextItemCommand}"
|
||||
Modifiers="{Binding SelectNextItemHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
|
||||
<KeyBinding
|
||||
Key="{Binding SelectPrevItemHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
|
||||
Command="{Binding SelectPrevItemCommand}"
|
||||
Modifiers="{Binding SelectPrevItemHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
|
||||
</Window.InputBindings>
|
||||
<Grid>
|
||||
<Border MouseDown="OnMouseDown" Style="{DynamicResource WindowBorderStyle}">
|
||||
|
|
|
|||
|
|
@ -2740,8 +2740,8 @@
|
|||
<Border Margin="0,16,0,0" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="Auto Complete Hotkey" />
|
||||
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="Auto Complete Hotkey Subtitle" />
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource autoCompleteHotkey}" />
|
||||
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource autoCompleteHotkeyToolTip}" />
|
||||
</StackPanel>
|
||||
<flowlauncher:HotkeyControl
|
||||
Grid.Row="0"
|
||||
|
|
@ -2751,7 +2751,43 @@
|
|||
HorizontalContentAlignment="Right"
|
||||
DataContext="{Binding AutoCompleteHotkeyViewModel}" />
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
<Border Margin="0,8,0,0" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource SelectNextItemHotkey}" />
|
||||
</StackPanel>
|
||||
<flowlauncher:HotkeyControl
|
||||
x:Name="SelectNextItemHotkeyControl"
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Margin="0,0,16,0"
|
||||
HorizontalAlignment="Right"
|
||||
HorizontalContentAlignment="Right"
|
||||
DataContext="{Binding SelectNextItemHotkeyViewModel}" />
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
<Border Margin="0,8,0,0" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource SelectPrevItemHotkey}" />
|
||||
</StackPanel>
|
||||
<flowlauncher:HotkeyControl
|
||||
x:Name="SelectPrevItemHotkeyControl"
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Margin="0,0,16,0"
|
||||
HorizontalAlignment="Right"
|
||||
HorizontalContentAlignment="Right"
|
||||
DataContext="{Binding SelectPrevItemHotkeyViewModel}" />
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
|
|
|||
|
|
@ -83,6 +83,12 @@ namespace Flow.Launcher.ViewModel
|
|||
case nameof(Settings.AutoCompleteHotkey):
|
||||
OnPropertyChanged(nameof(AutoCompleteHotkey));
|
||||
break;
|
||||
case nameof(Settings.SelectNextItemHotkey):
|
||||
OnPropertyChanged(nameof(SelectNextItemHotkey));
|
||||
break;
|
||||
case nameof(Settings.SelectPrevItemHotkey):
|
||||
OnPropertyChanged(nameof(SelectPrevItemHotkey));
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -647,7 +653,9 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public string PreviewHotkey => VerifyOrSetDefaultHotkey(Settings.PreviewHotkey, "F1");
|
||||
|
||||
public string AutoCompleteHotkey => VerifyOrSetDefaultHotkey(Settings.AutoCompleteHotkey, "Tab");
|
||||
public string AutoCompleteHotkey => VerifyOrSetDefaultHotkey(Settings.AutoCompleteHotkey, "");
|
||||
public string SelectNextItemHotkey => VerifyOrSetDefaultHotkey(Settings.SelectNextItemHotkey, "Tab");
|
||||
public string SelectPrevItemHotkey => VerifyOrSetDefaultHotkey(Settings.SelectPrevItemHotkey, "Shift + Tab");
|
||||
|
||||
|
||||
public string Image => Constant.QueryTextBoxIconImagePath;
|
||||
|
|
|
|||
|
|
@ -84,10 +84,21 @@ namespace Flow.Launcher.ViewModel
|
|||
});
|
||||
|
||||
AutoCompleteHotkeyViewModel =
|
||||
new HotkeyControlViewModel(Settings.AutoCompleteHotkey, "F2", false, hotkey =>
|
||||
new HotkeyControlViewModel(Settings.AutoCompleteHotkey, "Ctrl+P", false, hotkey =>
|
||||
{
|
||||
Settings.AutoCompleteHotkey = hotkey.ToString();
|
||||
});
|
||||
|
||||
SelectNextItemHotkeyViewModel =
|
||||
new HotkeyControlViewModel(Settings.SelectNextItemHotkey, "Tab", false, hotkey =>
|
||||
{
|
||||
Settings.SelectNextItemHotkey = hotkey.ToString();
|
||||
});
|
||||
SelectPrevItemHotkeyViewModel =
|
||||
new HotkeyControlViewModel(Settings.SelectPrevItemHotkey, "Shift+Tab", false, hotkey =>
|
||||
{
|
||||
Settings.SelectPrevItemHotkey = hotkey.ToString();
|
||||
});
|
||||
}
|
||||
|
||||
public Settings Settings { get; set; }
|
||||
|
|
@ -969,6 +980,8 @@ namespace Flow.Launcher.ViewModel
|
|||
public HotkeyControlViewModel ToggleHotkeyViewModel { get; set; }
|
||||
public HotkeyControlViewModel PreviewHotkeyViewModel { get; set; }
|
||||
public HotkeyControlViewModel AutoCompleteHotkeyViewModel { get; set; }
|
||||
public HotkeyControlViewModel SelectNextItemHotkeyViewModel { get; set; }
|
||||
public HotkeyControlViewModel SelectPrevItemHotkeyViewModel { get; set; }
|
||||
|
||||
private static DirectoryInfo GetLogDir(string version = "")
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue