From f2101026c3e8de39df97ee81e6e6ee59e5757bc6 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Fri, 23 Dec 2022 00:58:26 +0800 Subject: [PATCH] Use KeyBinding in xaml --- Flow.Launcher/MainWindow.xaml | 3 +++ Flow.Launcher/MainWindow.xaml.cs | 5 ----- Flow.Launcher/ViewModel/MainViewModel.cs | 5 +++++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index faf9f670a..79f40f192 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -181,6 +181,9 @@ Command="{Binding OpenResultCommand}" CommandParameter="9" Modifiers="{Binding OpenResultCommandModifiers}" /> + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index ac360e31c..569353514 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -620,11 +620,6 @@ namespace Flow.Launcher } } break; - case Key.F1: - PreviewToggle(); - e.Handled = true; - break; - default: break; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 93c6388b9..4601bb04d 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -74,6 +74,9 @@ namespace Flow.Launcher.ViewModel case nameof(Settings.AlwaysStartEn): OnPropertyChanged(nameof(StartWithEnglishMode)); break; + case nameof(Settings.PreviewHotkey): + OnPropertyChanged(nameof(TogglePreviewHotkey)); + break; } }; @@ -570,6 +573,8 @@ namespace Flow.Launcher.ViewModel public string OpenResultCommandModifiers { get; private set; } + public string TogglePreviewHotkey => Settings.PreviewHotkey; // TODO: is hotkey combo possible? + public string Image => Constant.QueryTextBoxIconImagePath; public bool StartWithEnglishMode => Settings.AlwaysStartEn;