From bf63ddad256e9f7b19c34910c54573d590eaee18 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 7 Apr 2025 11:23:50 +0800 Subject: [PATCH] Improve code quality --- .../SettingsPanePluginsViewModel.cs | 51 ++++++++++++++++++- .../Views/SettingsPanePlugins.xaml | 9 ++-- .../Views/SettingsPanePlugins.xaml.cs | 46 ----------------- 3 files changed, 56 insertions(+), 50 deletions(-) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs index b3cdda553..754b15989 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginsViewModel.cs @@ -1,16 +1,21 @@ using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows; +using CommunityToolkit.Mvvm.Input; using Flow.Launcher.Core.Plugin; using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.ViewModel; +using ModernWpf.Controls; #nullable enable namespace Flow.Launcher.SettingPages.ViewModels; -public class SettingsPanePluginsViewModel : BaseModel +public partial class SettingsPanePluginsViewModel : BaseModel { private readonly Settings _settings; @@ -147,4 +152,48 @@ public class SettingsPanePluginsViewModel : BaseModel StringMatcher.FuzzySearch(FilterText, v.PluginPair.Metadata.Description).IsSearchPrecisionScoreMet() ) .ToList(); + + [RelayCommand] + private async Task OpenHelperAsync() + { + var helpDialog = new ContentDialog() + { + Content = new StackPanel + { + Children = + { + new TextBlock + { + Text = (string)Application.Current.Resources["changePriorityWindow"], + FontSize = 18, + Margin = new Thickness(0, 0, 0, 10), + TextWrapping = TextWrapping.Wrap + }, + new TextBlock + { + Text = (string)Application.Current.Resources["priority_tips"], + TextWrapping = TextWrapping.Wrap + }, + new TextBlock + { + Text = (string)Application.Current.Resources["searchDelayTimeTitle"], + FontSize = 18, + Margin = new Thickness(0, 24, 0, 10), + TextWrapping = TextWrapping.Wrap + }, + new TextBlock + { + Text = (string)Application.Current.Resources["searchDelayTime_tips"], + TextWrapping = TextWrapping.Wrap + } + } + }, + + PrimaryButtonText = (string)Application.Current.Resources["commonOK"], + CornerRadius = new CornerRadius(8), + Style = (Style)Application.Current.Resources["ContentDialog"] + }; + + await helpDialog.ShowAsync(); + } } diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml index 10f82f535..5498b293c 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml @@ -47,10 +47,11 @@