From 5e87e18fd33241a74e0176bc22a44a4faae46201 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Fri, 12 Apr 2024 18:42:45 +0600 Subject: [PATCH] Fix the code merge mistake --- Flow.Launcher/HotkeyControl.xaml | 5 +-- Flow.Launcher/HotkeyControl.xaml.cs | 52 +++++++++++------------------ 2 files changed, 22 insertions(+), 35 deletions(-) diff --git a/Flow.Launcher/HotkeyControl.xaml b/Flow.Launcher/HotkeyControl.xaml index 6e91f2666..7e89aace0 100644 --- a/Flow.Launcher/HotkeyControl.xaml +++ b/Flow.Launcher/HotkeyControl.xaml @@ -39,10 +39,11 @@ + Foreground="{DynamicResource Color01B}" + Click="OnStartRecordingClicked"> diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs index 7a06343c6..5f2b48ec5 100644 --- a/Flow.Launcher/HotkeyControl.xaml.cs +++ b/Flow.Launcher/HotkeyControl.xaml.cs @@ -40,15 +40,6 @@ namespace Flow.Launcher public string[] KeysToDisplay => Hotkey.Split(" + "); - private bool _isEditingHotkey = false; - public bool IsEditingHotkey { - get => _isEditingHotkey; - set { - _isEditingHotkey = value; - OnPropertyChanged(); - } - } - #nullable enable public EventHandler? Action { get; set; } #nullable restore @@ -70,7 +61,7 @@ namespace Flow.Launcher /*------------------ New Logic Structure Part ------------------------*/ - private void ToggleOn() + private void OnStartRecordingClicked(object sender, RoutedEventArgs e) { if (HotkeyBtn.IsChecked == true) { @@ -80,7 +71,7 @@ namespace Flow.Launcher } } - private void StopRecPressed() + private void OnStopRecordingClicked(object sender, RoutedEventArgs e) { /* If Stop Button Pressed*/ /* 1. Save the REC Keys to settings @@ -89,6 +80,23 @@ namespace Flow.Launcher * 4. Change ToggleBtn isChcked to false */ } + private void OnResetToDefaultClicked(object sender, RoutedEventArgs e) + { + HotkeyBtn.IsChecked = false; + if (!string.IsNullOrEmpty(Hotkey)) + HotKeyMapper.RemoveHotkey(Hotkey); + Hotkey = DefaultHotkey; + HotKeyMapper.SetHotkey(new HotkeyModel(Hotkey), Action); + } + + private void OnDeleteClicked(object sender, RoutedEventArgs e) + { + HotkeyBtn.IsChecked = false; + if (!string.IsNullOrEmpty(Hotkey)) + HotKeyMapper.RemoveHotkey(Hotkey); + Hotkey = ""; + } + /*------------------ New Logic Structure Part------------------------*/ private void HotkeyControl_LostFocus(object o, RoutedEventArgs routedEventArgs) @@ -235,27 +243,5 @@ namespace Flow.Launcher { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } - - private void OnStopRecordingClicked(object sender, RoutedEventArgs e) - { - IsEditingHotkey = false; - } - - private void OnResetToDefaultClicked(object sender, RoutedEventArgs e) - { - IsEditingHotkey = false; - if (!string.IsNullOrEmpty(Hotkey)) - HotKeyMapper.RemoveHotkey(Hotkey); - Hotkey = DefaultHotkey; - HotKeyMapper.SetHotkey(new HotkeyModel(Hotkey), Action); - } - - private void OnDeleteClicked(object sender, RoutedEventArgs e) - { - IsEditingHotkey = false; - if (!string.IsNullOrEmpty(Hotkey)) - HotKeyMapper.RemoveHotkey(Hotkey); - Hotkey = ""; - } } }