From 07c5fa4f5f69895a887b76b77004b969a29debcd Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 16 Mar 2025 15:11:28 +0800 Subject: [PATCH] Improve code quality --- Flow.Launcher/MainWindow.xaml.cs | 6 ++---- Flow.Launcher/ViewModel/MainViewModel.cs | 5 ----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index e338bd587..c6cf55e64 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -187,10 +187,8 @@ namespace Flow.Launcher private void OnLoaded(object sender, RoutedEventArgs _) { - Dispatcher.BeginInvoke((Action)(() => - { - ThemeManager.Instance.RefreshFrame(); - }), DispatcherPriority.Background); + // Refresh frame + ThemeManager.Instance.RefreshFrame(); // MouseEventHandler PreviewMouseMove += MainPreviewMouseMove; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 8f9671a9e..72ab1d0b6 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -143,7 +143,6 @@ namespace Flow.Launcher.ViewModel _userSelectedRecord = _userSelectedRecordStorage.Load(); _topMostRecord = _topMostRecordStorage.Load(); - ContextMenu = new ResultsViewModel(Settings) { LeftClickResultCommand = OpenResultCommand, @@ -791,7 +790,6 @@ namespace Flow.Launcher.ViewModel public string CycleHistoryUpHotkey => VerifyOrSetDefaultHotkey(Settings.CycleHistoryUpHotkey, "Alt+Up"); public string CycleHistoryDownHotkey => VerifyOrSetDefaultHotkey(Settings.CycleHistoryDownHotkey, "Alt+Down"); - public string Image => Constant.QueryTextBoxIconImagePath; public bool StartWithEnglishMode => Settings.AlwaysStartEn; @@ -1407,7 +1405,6 @@ namespace Flow.Launcher.ViewModel }); } - public async void Hide() { lastHistoryIndex = 1; @@ -1483,8 +1480,6 @@ namespace Flow.Launcher.ViewModel VisibilityChanged?.Invoke(this, new VisibilityChangedEventArgs { IsVisible = false }); } - - /// /// Checks if Flow Launcher should ignore any hotkeys ///