fix some issue

This commit is contained in:
Hongtao Zhang 2024-04-17 13:34:49 -05:00
parent fb3eb06c74
commit fa0f4981c7
2 changed files with 4 additions and 6 deletions

View file

@ -92,14 +92,12 @@
Grid.Column="1"
Width="Auto"
Checked="HotkeyBtn_OnChecked"
Unchecked="HotkeyBtn_OnUnchecked"
FontSize="13"
FontWeight="Bold"
Foreground="{DynamicResource Color01B}"
GroupName="HotkeyReg"
KeyboardNavigation.TabNavigation="Continue"
PreviewKeyDown="OnPreviewKeyDown"
LostFocus="HotkeyBtn_OnLostFocus"
Style="{StaticResource {x:Type ToggleButton}}">
<RadioButton.Template>
<ControlTemplate TargetType="RadioButton">

View file

@ -51,6 +51,7 @@ namespace Flow.Launcher
if (d is HotkeyControl hotkeyControl)
{
hotkeyControl.SetKeysToDisplay(new HotkeyModel(hotkeyControl.Hotkey));
hotkeyControl.CurrentHotkey = new HotkeyModel(hotkeyControl.Hotkey);
}
}
@ -202,8 +203,6 @@ namespace Flow.Launcher
private void ResetToDefault()
{
HotkeyBtn.IsChecked = false;
if (!string.IsNullOrEmpty(Hotkey))
HotKeyMapper.RemoveHotkey(Hotkey);
Hotkey = DefaultHotkey;
@ -212,6 +211,8 @@ namespace Flow.Launcher
SetKeysToDisplay(CurrentHotkey);
SetHotkey(CurrentHotkey);
HotkeyBtn.IsChecked = false;
}
@ -241,12 +242,11 @@ namespace Flow.Launcher
public void Delete()
{
HotkeyBtn.IsChecked = false;
if (!string.IsNullOrEmpty(Hotkey))
HotKeyMapper.RemoveHotkey(Hotkey);
Hotkey = "";
SetKeysToDisplay(KeysToDisplay, new List<string>());
HotkeyBtn.IsChecked = false;
}
private void SetKeysToDisplay(HotkeyModel hotkey)