@@ -13,14 +13,14 @@ namespace Flow.Launcher
1313 public partial class CustomQueryHotkeySetting : Window
1414 {
1515 private SettingWindow _settingWidow ;
16+ private readonly Settings _settings ;
1617 private bool update ;
1718 private CustomPluginHotkey updateCustomHotkey ;
18- public Settings Settings { get ; }
1919
2020 public CustomQueryHotkeySetting ( SettingWindow settingWidow , Settings settings )
2121 {
2222 _settingWidow = settingWidow ;
23- Settings = settings ;
23+ _settings = settings ;
2424 InitializeComponent ( ) ;
2525 }
2626
@@ -33,13 +33,13 @@ private void btnAdd_OnClick(object sender, RoutedEventArgs e)
3333 {
3434 if ( ! update )
3535 {
36- Settings . CustomPluginHotkeys ??= new ObservableCollection < CustomPluginHotkey > ( ) ;
36+ _settings . CustomPluginHotkeys ??= new ObservableCollection < CustomPluginHotkey > ( ) ;
3737
3838 var pluginHotkey = new CustomPluginHotkey
3939 {
4040 Hotkey = HotkeyControl . CurrentHotkey . ToString ( ) , ActionKeyword = tbAction . Text
4141 } ;
42- Settings . CustomPluginHotkeys . Add ( pluginHotkey ) ;
42+ _settings . CustomPluginHotkeys . Add ( pluginHotkey ) ;
4343
4444 HotKeyMapper . SetCustomQueryHotkey ( pluginHotkey ) ;
4545 }
@@ -59,7 +59,7 @@ private void btnAdd_OnClick(object sender, RoutedEventArgs e)
5959
6060 public void UpdateItem ( CustomPluginHotkey item )
6161 {
62- updateCustomHotkey = Settings . CustomPluginHotkeys . FirstOrDefault ( o =>
62+ updateCustomHotkey = _settings . CustomPluginHotkeys . FirstOrDefault ( o =>
6363 o . ActionKeyword == item . ActionKeyword && o . Hotkey == item . Hotkey ) ;
6464 if ( updateCustomHotkey == null )
6565 {
@@ -77,8 +77,7 @@ public void UpdateItem(CustomPluginHotkey item)
7777 private void BtnTestActionKeyword_OnClick ( object sender , RoutedEventArgs e )
7878 {
7979 App . API . ChangeQuery ( tbAction . Text ) ;
80- Application . Current . MainWindow . Show ( ) ;
81- Application . Current . MainWindow . Opacity = 1 ;
80+ App . API . ShowMainWindow ( ) ;
8281 Application . Current . MainWindow . Focus ( ) ;
8382 }
8483
0 commit comments