Skip to content

Commit f210102

Browse files
Use KeyBinding in xaml
1 parent 33c0af1 commit f210102

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@
181181
Command="{Binding OpenResultCommand}"
182182
CommandParameter="9"
183183
Modifiers="{Binding OpenResultCommandModifiers}" />
184+
<KeyBinding
185+
Key="{Binding TogglePreviewHotkey}"
186+
Command="{Binding TogglePreviewCommand}"/>
184187
</Window.InputBindings>
185188
<Grid>
186189
<Border MouseDown="OnMouseDown" Style="{DynamicResource WindowBorderStyle}">

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -620,11 +620,6 @@ private void OnKeyDown(object sender, KeyEventArgs e)
620620
}
621621
}
622622
break;
623-
case Key.F1:
624-
PreviewToggle();
625-
e.Handled = true;
626-
break;
627-
628623
default:
629624
break;
630625

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public MainViewModel(Settings settings)
7474
case nameof(Settings.AlwaysStartEn):
7575
OnPropertyChanged(nameof(StartWithEnglishMode));
7676
break;
77+
case nameof(Settings.PreviewHotkey):
78+
OnPropertyChanged(nameof(TogglePreviewHotkey));
79+
break;
7780
}
7881
};
7982

@@ -570,6 +573,8 @@ public double MainWindowWidth
570573

571574
public string OpenResultCommandModifiers { get; private set; }
572575

576+
public string TogglePreviewHotkey => Settings.PreviewHotkey; // TODO: is hotkey combo possible?
577+
573578
public string Image => Constant.QueryTextBoxIconImagePath;
574579

575580
public bool StartWithEnglishMode => Settings.AlwaysStartEn;

0 commit comments

Comments
 (0)