mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #34 from gdziedzic/enhance-mod+num-launching
Enhance modifier + num launching
This commit is contained in:
commit
a4ef56cb46
29 changed files with 163 additions and 16 deletions
9
Flow.Launcher.Infrastructure/KeyConstant.cs
Normal file
9
Flow.Launcher.Infrastructure/KeyConstant.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
namespace Flow.Launcher.Infrastructure
|
||||
{
|
||||
public static class KeyConstant
|
||||
{
|
||||
public const string Ctrl = nameof(Ctrl);
|
||||
public const string Alt = nameof(Alt);
|
||||
public const string Space = nameof(Space);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,9 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
{
|
||||
public class Settings : BaseModel
|
||||
{
|
||||
public string Hotkey { get; set; } = "Alt + Space";
|
||||
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
|
||||
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
|
||||
public bool ShowOpenResultHotkey { get; set; } = true;
|
||||
public string Language { get; set; } = "en";
|
||||
public string Theme { get; set; } = "Dark";
|
||||
public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Flow.Launcher.Converters
|
||||
{
|
||||
[ValueConversion(typeof(bool), typeof(Visibility))]
|
||||
public class OpenResultHotkeyVisibilityConverter : IValueConverter
|
||||
{
|
||||
private const int MaxVisibleHotkeys = 9;
|
||||
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var hotkeyNumber = int.MaxValue;
|
||||
|
||||
if (value is ListBoxItem listBoxItem)
|
||||
{
|
||||
ListBox listBox = ItemsControl.ItemsControlFromItemContainer(listBoxItem) as ListBox;
|
||||
hotkeyNumber = listBox.ItemContainerGenerator.IndexFromContainer(listBoxItem) + 1;
|
||||
}
|
||||
|
||||
return hotkeyNumber <= MaxVisibleHotkeys ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException();
|
||||
}
|
||||
}
|
||||
22
Flow.Launcher/Converters/OrdinalConverter.cs
Normal file
22
Flow.Launcher/Converters/OrdinalConverter.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System.Globalization;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Flow.Launcher.Converters
|
||||
{
|
||||
public class OrdinalConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is ListBoxItem listBoxItem)
|
||||
{
|
||||
ListBox listBox = ItemsControl.ItemsControlFromItemContainer(listBoxItem) as ListBox;
|
||||
return listBox.ItemContainerGenerator.IndexFromContainer(listBoxItem) + 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) => throw new System.InvalidOperationException();
|
||||
}
|
||||
}
|
||||
|
|
@ -51,7 +51,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Genvejstast</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher genvejstast</system:String>
|
||||
<system:String x:Key="openResultModifiers">Åbn resultatmodifikatorer</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Tilpasset søgegenvejstast</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Vis hotkey</system:String>
|
||||
<system:String x:Key="delete">Slet</system:String>
|
||||
<system:String x:Key="edit">Rediger</system:String>
|
||||
<system:String x:Key="add">Tilføj</system:String>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Tastenkombination</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher Tastenkombination</system:String>
|
||||
<system:String x:Key="openResultModifiers">Öffnen Sie die Ergebnismodifikatoren</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Benutzerdefinierte Abfrage Tastenkombination</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Hotkey anzeigen</system:String>
|
||||
<system:String x:Key="delete">Löschen</system:String>
|
||||
<system:String x:Key="edit">Bearbeiten</system:String>
|
||||
<system:String x:Key="add">Hinzufügen</system:String>
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Hotkey</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher Hotkey</system:String>
|
||||
<system:String x:Key="openResultModifiers">Open Result Modifiers</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Show Hotkey</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Custom Query Hotkey</system:String>
|
||||
<system:String x:Key="delete">Delete</system:String>
|
||||
<system:String x:Key="edit">Edit</system:String>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Raccourcis</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Ouvrir Flow Launcher</system:String>
|
||||
<system:String x:Key="openResultModifiers">Modificateurs de résultats ouverts</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Requêtes personnalisées</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Afficher le raccourci clavier</system:String>
|
||||
<system:String x:Key="delete">Supprimer</system:String>
|
||||
<system:String x:Key="edit">Modifier</system:String>
|
||||
<system:String x:Key="add">Ajouter</system:String>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Tasti scelta rapida</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Tasto scelta rapida Flow Launcher</system:String>
|
||||
<system:String x:Key="openResultModifiers">Apri modificatori di risultato</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Tasti scelta rapida per ricerche personalizzate</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Mostra tasto di scelta rapida</system:String>
|
||||
<system:String x:Key="delete">Cancella</system:String>
|
||||
<system:String x:Key="edit">Modifica</system:String>
|
||||
<system:String x:Key="add">Aggiungi</system:String>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">ホットキー</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher ホットキー</system:String>
|
||||
<system:String x:Key="openResultModifiers">結果修飾子を開く</system:String>
|
||||
<system:String x:Key="customQueryHotkey">カスタムクエリ ホットキー</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">ホットキーを表示</system:String>
|
||||
<system:String x:Key="delete">削除</system:String>
|
||||
<system:String x:Key="edit">編集</system:String>
|
||||
<system:String x:Key="add">追加</system:String>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">핫키</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher 핫키</system:String>
|
||||
<system:String x:Key="openResultModifiers">결과 수정 자 열기</system:String>
|
||||
<system:String x:Key="customQueryHotkey">사용자지정 쿼리 핫키</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">단축키 표시</system:String>
|
||||
<system:String x:Key="delete">삭제</system:String>
|
||||
<system:String x:Key="edit">편집</system:String>
|
||||
<system:String x:Key="add">추가</system:String>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Hurtigtast</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher-hurtigtast</system:String>
|
||||
<system:String x:Key="openResultModifiers">Åpne resultatmodifiserere</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Egendefinerd spørringshurtigtast</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Vis hurtigtast</system:String>
|
||||
<system:String x:Key="delete">Slett</system:String>
|
||||
<system:String x:Key="edit">Rediger</system:String>
|
||||
<system:String x:Key="add">Legg til</system:String>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Sneltoets</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher Sneltoets</system:String>
|
||||
<system:String x:Key="openResultModifiers">Open resultaatmodificatoren</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Custom Query Sneltoets</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Sneltoets weergeven</system:String>
|
||||
<system:String x:Key="delete">Verwijder</system:String>
|
||||
<system:String x:Key="edit">Bewerken</system:String>
|
||||
<system:String x:Key="add">Toevoegen</system:String>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Skrót klawiszowy</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Skrót klawiszowy Flow Launcher</system:String>
|
||||
<system:String x:Key="openResultModifiers">Modyfikatory klawiszów otwierających wyniki</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Skrót klawiszowy niestandardowych zapytań</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Pokaż skrót klawiszowy</system:String>
|
||||
<system:String x:Key="delete">Usuń</system:String>
|
||||
<system:String x:Key="edit">Edytuj</system:String>
|
||||
<system:String x:Key="add">Dodaj</system:String>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Atalho</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Atalho do Flow Launcher</system:String>
|
||||
<system:String x:Key="openResultModifiers">Modificadores de resultado aberto</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Atalho de Consulta Personalizada</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Mostrar tecla de atalho</system:String>
|
||||
<system:String x:Key="delete">Apagar</system:String>
|
||||
<system:String x:Key="edit">Editar</system:String>
|
||||
<system:String x:Key="add">Adicionar</system:String>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Горячие клавиши</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Горячая клавиша Flow Launcher</system:String>
|
||||
<system:String x:Key="openResultModifiers">Модификаторы открытого результата</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Задаваемые горячие клавиши для запросов</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Показать Hotkey</system:String>
|
||||
<system:String x:Key="delete">Удалить</system:String>
|
||||
<system:String x:Key="edit">Изменить</system:String>
|
||||
<system:String x:Key="add">Добавить</system:String>
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Klávesová skratka</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Klávesová skratka pre Flow Launcher</system:String>
|
||||
<system:String x:Key="openResultModifiers">Otvorte modifikátory výsledkov</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Vlastná klávesová skratka pre dopyt</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Zobraziť klávesovú skratku</system:String>
|
||||
<system:String x:Key="delete">Odstrániť</system:String>
|
||||
<system:String x:Key="edit">Upraviť</system:String>
|
||||
<system:String x:Key="add">Pridať</system:String>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Prečica</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher prečica</system:String>
|
||||
<system:String x:Key="openResultModifiers">Отворите модификаторе резултата</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">покажи хоткеи</system:String>
|
||||
<system:String x:Key="customQueryHotkey">prečica za ručno dodat upit</system:String>
|
||||
<system:String x:Key="delete">Obriši</system:String>
|
||||
<system:String x:Key="edit">Izmeni</system:String>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Kısayol Tuşu</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher Kısayolu</system:String>
|
||||
<system:String x:Key="openResultModifiers">Açık Sonuç Değiştiricileri</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Özel Sorgu Kısayolları</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Kısayol Tuşunu Göster</system:String>
|
||||
<system:String x:Key="delete">Sil</system:String>
|
||||
<system:String x:Key="edit">Düzenle</system:String>
|
||||
<system:String x:Key="add">Ekle</system:String>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@
|
|||
<!--Setting Hotkey-->
|
||||
<system:String x:Key="hotkey">Гарячі клавіші</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Гаряча клавіша Flow Launcher</system:String>
|
||||
<system:String x:Key="openResultModifiers">Відкриті модифікатори результатів</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Задані гарячі клавіші для запитів</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">Показати клавішу швидкого доступу</system:String>
|
||||
<system:String x:Key="delete">Видалити</system:String>
|
||||
<system:String x:Key="edit">Змінити</system:String>
|
||||
<system:String x:Key="add">Додати</system:String>
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@
|
|||
<!--设置,热键-->
|
||||
<system:String x:Key="hotkey">热键</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher激活热键</system:String>
|
||||
<system:String x:Key="openResultModifiers">开放结果修饰符</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">显示热键</system:String>
|
||||
<system:String x:Key="customQueryHotkey">自定义查询热键</system:String>
|
||||
<system:String x:Key="delete">删除</system:String>
|
||||
<system:String x:Key="edit">编辑</system:String>
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@
|
|||
<!--設置,熱鍵-->
|
||||
<system:String x:Key="hotkey">熱鍵</system:String>
|
||||
<system:String x:Key="flowlauncherHotkey">Flow Launcher 執行熱鍵</system:String>
|
||||
<system:String x:Key="openResultModifiers">開放結果修飾符</system:String>
|
||||
<system:String x:Key="customQueryHotkey">自定義熱鍵查詢</system:String>
|
||||
<system:String x:Key="showOpenResultHotkey">顯示熱鍵</system:String>
|
||||
<system:String x:Key="delete">刪除</system:String>
|
||||
<system:String x:Key="edit">編輯</system:String>
|
||||
<system:String x:Key="add">新增</system:String>
|
||||
|
|
|
|||
|
|
@ -48,15 +48,15 @@
|
|||
<KeyBinding Key="Enter" Command="{Binding OpenResultCommand}"></KeyBinding>
|
||||
<KeyBinding Key="Enter" Modifiers="Ctrl" Command="{Binding OpenResultCommand}"></KeyBinding>
|
||||
<KeyBinding Key="Enter" Modifiers="Alt" Command="{Binding OpenResultCommand}"></KeyBinding>
|
||||
<KeyBinding Key="D1" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="0"></KeyBinding>
|
||||
<KeyBinding Key="D2" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="1"></KeyBinding>
|
||||
<KeyBinding Key="D3" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="2"></KeyBinding>
|
||||
<KeyBinding Key="D4" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="3"></KeyBinding>
|
||||
<KeyBinding Key="D5" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="4"></KeyBinding>
|
||||
<KeyBinding Key="D6" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="5"></KeyBinding>
|
||||
<KeyBinding Key="D7" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="6"></KeyBinding>
|
||||
<KeyBinding Key="D8" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="7"></KeyBinding>
|
||||
<KeyBinding Key="D9" Modifiers="Alt" Command="{Binding OpenResultCommand}" CommandParameter="8"></KeyBinding>
|
||||
<KeyBinding Key="D1" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="0"></KeyBinding>
|
||||
<KeyBinding Key="D2" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="1"></KeyBinding>
|
||||
<KeyBinding Key="D3" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="2"></KeyBinding>
|
||||
<KeyBinding Key="D4" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="3"></KeyBinding>
|
||||
<KeyBinding Key="D5" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="4"></KeyBinding>
|
||||
<KeyBinding Key="D6" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="5"></KeyBinding>
|
||||
<KeyBinding Key="D7" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="6"></KeyBinding>
|
||||
<KeyBinding Key="D8" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="7"></KeyBinding>
|
||||
<KeyBinding Key="D9" Modifiers="{Binding OpenResultCommandModifiers}" Command="{Binding OpenResultCommand}" CommandParameter="8"></KeyBinding>
|
||||
</Window.InputBindings>
|
||||
<Border Style="{DynamicResource WindowBorderStyle}" MouseDown="OnMouseDown" >
|
||||
<StackPanel Orientation="Vertical">
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
Cursor="Hand" UseLayoutRounding="False">
|
||||
<Grid.Resources>
|
||||
<converter:HighlightTextConverter x:Key="HighlightTextConverter"/>
|
||||
<converter:OrdinalConverter x:Key="OrdinalConverter" />
|
||||
<converter:OpenResultHotkeyVisibilityConverter x:Key="OpenResultHotkeyVisibilityConverter" />
|
||||
</Grid.Resources>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="32" />
|
||||
|
|
@ -46,6 +48,19 @@
|
|||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" x:Name="SubTitleRowDefinition" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Visibility="{Binding ShowOpenResultHotkey}">
|
||||
<TextBlock Margin="0 5 5 0" Style="{DynamicResource ItemSubTitleStyle}" HorizontalAlignment="Right" Opacity="0.8" >
|
||||
<TextBlock.Visibility>
|
||||
<Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" Converter="{StaticResource ResourceKey=OpenResultHotkeyVisibilityConverter}" />
|
||||
</TextBlock.Visibility>
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0}+{1}">
|
||||
<Binding Path="OpenResultModifiers" />
|
||||
<Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" Converter="{StaticResource ResourceKey=OrdinalConverter}" />
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<TextBlock Style="{DynamicResource ItemTitleStyle}" DockPanel.Dock="Left"
|
||||
VerticalAlignment="Center" ToolTip="{Binding Result.Title}" x:Name="Title"
|
||||
Text="{Binding Result.Title}">
|
||||
|
|
|
|||
|
|
@ -287,9 +287,10 @@
|
|||
<TabItem Header="{DynamicResource hotkey}">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="35" />
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="400" />
|
||||
<RowDefinition Height="365" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" Height="24"
|
||||
|
|
@ -298,11 +299,21 @@
|
|||
<flowlauncher:HotkeyControl x:Name="HotkeyControl" HotkeyChanged="OnHotkeyChanged"
|
||||
Loaded="OnHotkeyControlLoaded" />
|
||||
</StackPanel>
|
||||
<TextBlock VerticalAlignment="Center" Grid.Row="1" Margin="0,3,10,2"
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center" Height="24"
|
||||
Margin="0,4,0,3">
|
||||
<TextBlock VerticalAlignment="Center" Margin="0 0 10 0" Text="{DynamicResource openResultModifiers}" />
|
||||
<ComboBox Margin="0 0 0 0" Width="120"
|
||||
ItemsSource="{Binding OpenResultModifiersList}"
|
||||
SelectedItem="{Binding Settings.OpenResultModifiers}" />
|
||||
<CheckBox Margin="10 0 0 0" IsChecked="{Binding Settings.ShowOpenResultHotkey}" VerticalAlignment="Center">
|
||||
<TextBlock Text="{DynamicResource showOpenResultHotkey}" />
|
||||
</CheckBox>
|
||||
</StackPanel>
|
||||
<TextBlock VerticalAlignment="Center" Grid.Row="2" Margin="0,3,10,2"
|
||||
Text="{DynamicResource customQueryHotkey}" />
|
||||
<ListView ItemsSource="{Binding Settings.CustomPluginHotkeys}"
|
||||
SelectedItem="{Binding SelectedCustomPluginHotkey}"
|
||||
Margin="0 5 0 0" Grid.Row="2">
|
||||
Margin="0 5 0 0" Grid.Row="3">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="{DynamicResource hotkey}" Width="180">
|
||||
|
|
@ -322,7 +333,7 @@
|
|||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
<StackPanel Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||
<StackPanel Grid.Row="4" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||
Orientation="Horizontal" Height="40" Width="360">
|
||||
<Button Click="OnDeleteCustomHotkeyClick" Width="100"
|
||||
Margin="10" Content="{DynamicResource delete}" />
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
#region Private Fields
|
||||
|
||||
private const string DefaultOpenResultModifiers = "Alt";
|
||||
|
||||
private bool _isQueryRunning;
|
||||
private Query _lastQuery;
|
||||
private string _queryTextBeforeLeaveResults;
|
||||
|
|
@ -74,6 +76,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
SetHotkey(_settings.Hotkey, OnHotkey);
|
||||
SetCustomPluginHotkey();
|
||||
SetOpenResultModifiers();
|
||||
}
|
||||
|
||||
private void RegisterResultsUpdatedEvent()
|
||||
|
|
@ -277,6 +280,8 @@ namespace Flow.Launcher.ViewModel
|
|||
public ICommand LoadHistoryCommand { get; set; }
|
||||
public ICommand OpenResultCommand { get; set; }
|
||||
|
||||
public string OpenResultCommandModifiers { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public void Query()
|
||||
|
|
@ -594,6 +599,11 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
private void SetOpenResultModifiers()
|
||||
{
|
||||
OpenResultCommandModifiers = _settings.OpenResultModifiers ?? DefaultOpenResultModifiers;
|
||||
}
|
||||
|
||||
private void OnHotkey(object sender, HotkeyEventArgs e)
|
||||
{
|
||||
if (!ShouldIgnoreHotkeys())
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using Flow.Launcher.Infrastructure;
|
||||
using Flow.Launcher.Infrastructure.Image;
|
||||
using Flow.Launcher.Infrastructure.Logger;
|
||||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using Flow.Launcher.Plugin;
|
||||
|
||||
|
||||
|
|
@ -11,14 +13,22 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
public class ResultViewModel : BaseModel
|
||||
{
|
||||
public ResultViewModel(Result result)
|
||||
public ResultViewModel(Result result, Settings settings)
|
||||
{
|
||||
if (result != null)
|
||||
{
|
||||
Result = result;
|
||||
}
|
||||
|
||||
Settings = settings;
|
||||
}
|
||||
|
||||
public Settings Settings { get; private set; }
|
||||
|
||||
public Visibility ShowOpenResultHotkey => Settings.ShowOpenResultHotkey ? Visibility.Visible : Visibility.Hidden;
|
||||
|
||||
public string OpenResultModifiers => Settings.OpenResultModifiers;
|
||||
|
||||
public ImageSource Image
|
||||
{
|
||||
get
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ namespace Flow.Launcher.ViewModel
|
|||
private List<ResultViewModel> NewResults(List<Result> newRawResults, string resultId)
|
||||
{
|
||||
var results = Results.ToList();
|
||||
var newResults = newRawResults.Select(r => new ResultViewModel(r)).ToList();
|
||||
var newResults = newRawResults.Select(r => new ResultViewModel(r, _settings)).ToList();
|
||||
var oldResults = results.Where(r => r.Result.PluginID == resultId).ToList();
|
||||
|
||||
// Find the same results in A (old results) and B (new newResults)
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public List<string> OpenResultModifiersList => new List<string> { KeyConstant.Alt, KeyConstant.Ctrl, $"{KeyConstant.Ctrl}+{KeyConstant.Alt}" };
|
||||
private Internationalization _translater => InternationalizationManager.Instance;
|
||||
public List<Language> Languages => _translater.LoadAvailableLanguages();
|
||||
public IEnumerable<int> MaxResultsRange => Enumerable.Range(2, 16);
|
||||
|
|
|
|||
Loading…
Reference in a new issue