mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
handle lostfocus
This commit is contained in:
parent
c9b5159ffd
commit
b7ccab67d1
3 changed files with 11 additions and 0 deletions
|
|
@ -100,6 +100,7 @@
|
|||
IsChecked="{Binding Recording}"
|
||||
KeyboardNavigation.TabNavigation="Continue"
|
||||
PreviewKeyDown="OnPreviewKeyDown"
|
||||
LostFocus="HotkeyBtn_OnLostFocus"
|
||||
Style="{StaticResource {x:Type ToggleButton}}">
|
||||
<RadioButton.Template>
|
||||
<ControlTemplate TargetType="RadioButton">
|
||||
|
|
|
|||
|
|
@ -93,5 +93,10 @@ namespace Flow.Launcher
|
|||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private void HotkeyBtn_OnLostFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_ = ((HotkeyControlViewModel)DataContext).RegisterHotkey();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,6 +222,11 @@ namespace Flow.Launcher.ViewModel
|
|||
container.Add(EmptyHotkey);
|
||||
}
|
||||
}
|
||||
|
||||
public Task RegisterHotkey()
|
||||
{
|
||||
return SetHotkeyAsync(Hotkey, true);
|
||||
}
|
||||
|
||||
public Task SetHotkeyAsync(string? keyStr, bool triggerValidate = true)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue