Ability to hide mod+num. Display full hotkey.

This commit is contained in:
Grzegorz Dziedzic 2020-05-03 23:36:23 +02:00
parent 10c16f059e
commit 6bc0ae6a82
25 changed files with 54 additions and 7 deletions

View 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);
}
}

View file

@ -9,8 +9,9 @@ namespace Flow.Launcher.Infrastructure.UserSettings
{ {
public class Settings : BaseModel 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; } = "Alt"; public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
public bool ShowOpenResultHotkey { get; set; } = true;
public string Language { get; set; } = "en"; public string Language { get; set; } = "en";
public string Theme { get; set; } = "Dark"; public string Theme { get; set; } = "Dark";
public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name; public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name;

View file

@ -53,6 +53,7 @@
<system:String x:Key="flowlauncherHotkey">Flow Launcher 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="openResultModifiers">Åbn resultatmodifikatorer</system:String>
<system:String x:Key="customQueryHotkey">Tilpasset søgegenvejstast</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="delete">Slet</system:String>
<system:String x:Key="edit">Rediger</system:String> <system:String x:Key="edit">Rediger</system:String>
<system:String x:Key="add">Tilføj</system:String> <system:String x:Key="add">Tilføj</system:String>

View file

@ -53,6 +53,7 @@
<system:String x:Key="flowlauncherHotkey">Flow Launcher 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="openResultModifiers">Öffnen Sie die Ergebnismodifikatoren</system:String>
<system:String x:Key="customQueryHotkey">Benutzerdefinierte Abfrage Tastenkombination</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="delete">Löschen</system:String>
<system:String x:Key="edit">Bearbeiten</system:String> <system:String x:Key="edit">Bearbeiten</system:String>
<system:String x:Key="add">Hinzufügen</system:String> <system:String x:Key="add">Hinzufügen</system:String>

View file

@ -61,6 +61,7 @@
<system:String x:Key="hotkey">Hotkey</system:String> <system:String x:Key="hotkey">Hotkey</system:String>
<system:String x:Key="flowlauncherHotkey">Flow Launcher 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="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="customQueryHotkey">Custom Query Hotkey</system:String>
<system:String x:Key="delete">Delete</system:String> <system:String x:Key="delete">Delete</system:String>
<system:String x:Key="edit">Edit</system:String> <system:String x:Key="edit">Edit</system:String>

View file

@ -57,6 +57,7 @@
<system:String x:Key="flowlauncherHotkey">Ouvrir Flow Launcher</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="openResultModifiers">Modificateurs de résultats ouverts</system:String>
<system:String x:Key="customQueryHotkey">Requêtes personnalisées</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="delete">Supprimer</system:String>
<system:String x:Key="edit">Modifier</system:String> <system:String x:Key="edit">Modifier</system:String>
<system:String x:Key="add">Ajouter</system:String> <system:String x:Key="add">Ajouter</system:String>

View file

@ -57,6 +57,7 @@
<system:String x:Key="flowlauncherHotkey">Tasto scelta rapida Flow Launcher</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="openResultModifiers">Apri modificatori di risultato</system:String>
<system:String x:Key="customQueryHotkey">Tasti scelta rapida per ricerche personalizzate</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="delete">Cancella</system:String>
<system:String x:Key="edit">Modifica</system:String> <system:String x:Key="edit">Modifica</system:String>
<system:String x:Key="add">Aggiungi</system:String> <system:String x:Key="add">Aggiungi</system:String>

View file

@ -60,6 +60,7 @@
<system:String x:Key="flowlauncherHotkey">Flow Launcher ホットキー</system:String> <system:String x:Key="flowlauncherHotkey">Flow Launcher ホットキー</system:String>
<system:String x:Key="openResultModifiers">結果修飾子を開く</system:String> <system:String x:Key="openResultModifiers">結果修飾子を開く</system:String>
<system:String x:Key="customQueryHotkey">カスタムクエリ ホットキー</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="delete">削除</system:String>
<system:String x:Key="edit">編集</system:String> <system:String x:Key="edit">編集</system:String>
<system:String x:Key="add">追加</system:String> <system:String x:Key="add">追加</system:String>

View file

@ -57,6 +57,7 @@
<system:String x:Key="flowlauncherHotkey">Flow Launcher 핫키</system:String> <system:String x:Key="flowlauncherHotkey">Flow Launcher 핫키</system:String>
<system:String x:Key="openResultModifiers">결과 수정 자 열기</system:String> <system:String x:Key="openResultModifiers">결과 수정 자 열기</system:String>
<system:String x:Key="customQueryHotkey">사용자지정 쿼리 핫키</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="delete">삭제</system:String>
<system:String x:Key="edit">편집</system:String> <system:String x:Key="edit">편집</system:String>
<system:String x:Key="add">추가</system:String> <system:String x:Key="add">추가</system:String>

View file

@ -57,6 +57,7 @@
<system:String x:Key="flowlauncherHotkey">Flow Launcher-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="openResultModifiers">Åpne resultatmodifiserere</system:String>
<system:String x:Key="customQueryHotkey">Egendefinerd spørringshurtigtast</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="delete">Slett</system:String>
<system:String x:Key="edit">Rediger</system:String> <system:String x:Key="edit">Rediger</system:String>
<system:String x:Key="add">Legg til</system:String> <system:String x:Key="add">Legg til</system:String>

View file

@ -53,6 +53,7 @@
<system:String x:Key="flowlauncherHotkey">Flow Launcher 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="openResultModifiers">Open resultaatmodificatoren</system:String>
<system:String x:Key="customQueryHotkey">Custom Query Sneltoets</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="delete">Verwijder</system:String>
<system:String x:Key="edit">Bewerken</system:String> <system:String x:Key="edit">Bewerken</system:String>
<system:String x:Key="add">Toevoegen</system:String> <system:String x:Key="add">Toevoegen</system:String>

View file

@ -53,6 +53,7 @@
<system:String x:Key="flowlauncherHotkey">Skrót klawiszowy Flow Launcher</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="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="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="delete">Usuń</system:String>
<system:String x:Key="edit">Edytuj</system:String> <system:String x:Key="edit">Edytuj</system:String>
<system:String x:Key="add">Dodaj</system:String> <system:String x:Key="add">Dodaj</system:String>

View file

@ -57,6 +57,7 @@
<system:String x:Key="flowlauncherHotkey">Atalho do Flow Launcher</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="openResultModifiers">Modificadores de resultado aberto</system:String>
<system:String x:Key="customQueryHotkey">Atalho de Consulta Personalizada</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="delete">Apagar</system:String>
<system:String x:Key="edit">Editar</system:String> <system:String x:Key="edit">Editar</system:String>
<system:String x:Key="add">Adicionar</system:String> <system:String x:Key="add">Adicionar</system:String>

View file

@ -53,6 +53,7 @@
<system:String x:Key="flowlauncherHotkey">Горячая клавиша Flow Launcher</system:String> <system:String x:Key="flowlauncherHotkey">Горячая клавиша Flow Launcher</system:String>
<system:String x:Key="openResultModifiers">Модификаторы открытого результата</system:String> <system:String x:Key="openResultModifiers">Модификаторы открытого результата</system:String>
<system:String x:Key="customQueryHotkey">Задаваемые горячие клавиши для запросов</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="delete">Удалить</system:String>
<system:String x:Key="edit">Изменить</system:String> <system:String x:Key="edit">Изменить</system:String>
<system:String x:Key="add">Добавить</system:String> <system:String x:Key="add">Добавить</system:String>

View file

@ -58,6 +58,7 @@
<system:String x:Key="flowlauncherHotkey">Klávesová skratka pre Flow Launcher</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="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="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="delete">Odstrániť</system:String>
<system:String x:Key="edit">Upraviť</system:String> <system:String x:Key="edit">Upraviť</system:String>
<system:String x:Key="add">Pridať</system:String> <system:String x:Key="add">Pridať</system:String>

View file

@ -56,6 +56,7 @@
<system:String x:Key="hotkey">Prečica</system:String> <system:String x:Key="hotkey">Prečica</system:String>
<system:String x:Key="flowlauncherHotkey">Flow Launcher 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="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="customQueryHotkey">prečica za ručno dodat upit</system:String>
<system:String x:Key="delete">Obriši</system:String> <system:String x:Key="delete">Obriši</system:String>
<system:String x:Key="edit">Izmeni</system:String> <system:String x:Key="edit">Izmeni</system:String>

View file

@ -61,6 +61,7 @@
<system:String x:Key="flowlauncherHotkey">Flow Launcher Kısayolu</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="openResultModifiers">Açık Sonuç Değiştiricileri</system:String>
<system:String x:Key="customQueryHotkey">Özel Sorgu Kısayolları</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="delete">Sil</system:String>
<system:String x:Key="edit">Düzenle</system:String> <system:String x:Key="edit">Düzenle</system:String>
<system:String x:Key="add">Ekle</system:String> <system:String x:Key="add">Ekle</system:String>

View file

@ -53,6 +53,7 @@
<system:String x:Key="flowlauncherHotkey">Гаряча клавіша Flow Launcher</system:String> <system:String x:Key="flowlauncherHotkey">Гаряча клавіша Flow Launcher</system:String>
<system:String x:Key="openResultModifiers">Відкриті модифікатори результатів</system:String> <system:String x:Key="openResultModifiers">Відкриті модифікатори результатів</system:String>
<system:String x:Key="customQueryHotkey">Задані гарячі клавіші для запитів</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="delete">Видалити</system:String>
<system:String x:Key="edit">Змінити</system:String> <system:String x:Key="edit">Змінити</system:String>
<system:String x:Key="add">Додати</system:String> <system:String x:Key="add">Додати</system:String>

View file

@ -59,6 +59,7 @@
<system:String x:Key="hotkey">热键</system:String> <system:String x:Key="hotkey">热键</system:String>
<system:String x:Key="flowlauncherHotkey">Flow Launcher激活热键</system:String> <system:String x:Key="flowlauncherHotkey">Flow Launcher激活热键</system:String>
<system:String x:Key="openResultModifiers">开放结果修饰符</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="customQueryHotkey">自定义查询热键</system:String>
<system:String x:Key="delete">删除</system:String> <system:String x:Key="delete">删除</system:String>
<system:String x:Key="edit">编辑</system:String> <system:String x:Key="edit">编辑</system:String>

View file

@ -53,6 +53,7 @@
<system:String x:Key="flowlauncherHotkey">Flow Launcher 執行熱鍵</system:String> <system:String x:Key="flowlauncherHotkey">Flow Launcher 執行熱鍵</system:String>
<system:String x:Key="openResultModifiers">開放結果修飾符</system:String> <system:String x:Key="openResultModifiers">開放結果修飾符</system:String>
<system:String x:Key="customQueryHotkey">自定義熱鍵查詢</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="delete">刪除</system:String>
<system:String x:Key="edit">編輯</system:String> <system:String x:Key="edit">編輯</system:String>
<system:String x:Key="add">新增</system:String> <system:String x:Key="add">新增</system:String>

View file

@ -47,8 +47,14 @@
<RowDefinition /> <RowDefinition />
<RowDefinition Height="Auto" x:Name="SubTitleRowDefinition" /> <RowDefinition Height="Auto" x:Name="SubTitleRowDefinition" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Margin="0 5 5 0" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, <TextBlock Margin="0 5 5 0" Visibility="{Binding ShowOpenResultHotkey}" Style="{DynamicResource ItemSubTitleStyle}" HorizontalAlignment="Right" Opacity="0.8" >
Converter={StaticResource ResourceKey=OrdinalConverter}, StringFormat={}Mod+{0}}" Style="{DynamicResource ItemTitleStyle}" HorizontalAlignment="Right" Opacity="0.3" /> <TextBlock.Text>
<MultiBinding StringFormat="{}{0}+{1}">
<Binding Path="OpenResultModifiers" />
<Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}" Converter="{StaticResource ResourceKey=OrdinalConverter}"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock Style="{DynamicResource ItemTitleStyle}" DockPanel.Dock="Left" <TextBlock Style="{DynamicResource ItemTitleStyle}" DockPanel.Dock="Left"
VerticalAlignment="Center" ToolTip="{Binding Result.Title}" x:Name="Title" VerticalAlignment="Center" ToolTip="{Binding Result.Title}" x:Name="Title"
Text="{Binding Result.Title}"> Text="{Binding Result.Title}">

View file

@ -305,6 +305,9 @@
<ComboBox Margin="0 0 0 0" Width="120" <ComboBox Margin="0 0 0 0" Width="120"
ItemsSource="{Binding OpenResultModifiersList}" ItemsSource="{Binding OpenResultModifiersList}"
SelectedItem="{Binding Settings.OpenResultModifiers}" /> SelectedItem="{Binding Settings.OpenResultModifiers}" />
<CheckBox Margin="10 0 0 0" IsChecked="{Binding Settings.ShowOpenResultHotkey}" VerticalAlignment="Center">
<TextBlock Text="{DynamicResource showOpenResultHotkey}" />
</CheckBox>
</StackPanel> </StackPanel>
<TextBlock VerticalAlignment="Center" Grid.Row="2" Margin="0,3,10,2" <TextBlock VerticalAlignment="Center" Grid.Row="2" Margin="0,3,10,2"
Text="{DynamicResource customQueryHotkey}" /> Text="{DynamicResource customQueryHotkey}" />

View file

@ -1,9 +1,11 @@
using System; using System;
using System.Windows;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading; using System.Windows.Threading;
using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Image; using Flow.Launcher.Infrastructure.Image;
using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
@ -11,14 +13,22 @@ namespace Flow.Launcher.ViewModel
{ {
public class ResultViewModel : BaseModel public class ResultViewModel : BaseModel
{ {
public ResultViewModel(Result result) public ResultViewModel(Result result, Settings settings)
{ {
if (result != null) if (result != null)
{ {
Result = result; 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 public ImageSource Image
{ {
get get

View file

@ -156,7 +156,7 @@ namespace Flow.Launcher.ViewModel
private List<ResultViewModel> NewResults(List<Result> newRawResults, string resultId) private List<ResultViewModel> NewResults(List<Result> newRawResults, string resultId)
{ {
var results = Results.ToList(); 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(); var oldResults = results.Where(r => r.Result.PluginID == resultId).ToList();
// Find the same results in A (old results) and B (new newResults) // Find the same results in A (old results) and B (new newResults)

View file

@ -139,7 +139,7 @@ namespace Flow.Launcher.ViewModel
} }
} }
public List<string> OpenResultModifiersList => new List<string> { "Alt", "Ctrl", "Ctrl+Alt" }; public List<string> OpenResultModifiersList => new List<string> { KeyConstant.Alt, KeyConstant.Ctrl, $"{KeyConstant.Ctrl}+{KeyConstant.Alt}" };
private Internationalization _translater => InternationalizationManager.Instance; private Internationalization _translater => InternationalizationManager.Instance;
public List<Language> Languages => _translater.LoadAvailableLanguages(); public List<Language> Languages => _translater.LoadAvailableLanguages();
public IEnumerable<int> MaxResultsRange => Enumerable.Range(2, 16); public IEnumerable<int> MaxResultsRange => Enumerable.Range(2, 16);