diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index d8c94390b..7d144e3a1 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -901,6 +901,7 @@ + @@ -912,12 +913,23 @@ Text="{DynamicResource plugin}" TextAlignment="left" /> + + + ThemeManager.Current.ApplicationTheme = settings.ColorScheme switch { Constant.Light => ApplicationTheme.Light, @@ -370,5 +379,22 @@ namespace Flow.Launcher RefreshMaximizeRestoreButton(); } + private CollectionView pluginListView; + + private bool PluginFilter(object item) + { + if (string.IsNullOrEmpty(pluginFilterTxb.Text)) + return true; + if (item is PluginViewModel model) + { + return StringMatcher.FuzzySearch(pluginFilterTxb.Text, model.PluginPair.Metadata.Name).IsSearchPrecisionScoreMet(); + } + return false; + } + + private void OnPluginSearchTextChanged(object sender, TextChangedEventArgs e) + { + pluginListView.Refresh(); + } } -} +} \ No newline at end of file diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index 209198822..864a60646 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -30,9 +30,20 @@ namespace Flow.Launcher.ViewModel get => !PluginPair.Metadata.Disabled; set => PluginPair.Metadata.Disabled = !value; } + public bool IsExpanded + { + get => _isExpanded; + set + { + _isExpanded = value; + OnPropertyChanged(); + OnPropertyChanged(nameof(SettingControl)); + } + } private Control _settingControl; - public Control SettingControl => _settingControl ??= PluginPair.Plugin is not ISettingProvider settingProvider ? new Control() : settingProvider.CreateSettingPanel(); + private bool _isExpanded; + public Control SettingControl => IsExpanded ? _settingControl ??= PluginPair.Plugin is not ISettingProvider settingProvider ? new Control() : settingProvider.CreateSettingPanel() : null; public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count == 1 ? Visibility.Visible : Visibility.Collapsed; public string InitilizaTime => PluginPair.Metadata.InitTime + "ms"; diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index 342c85da2..7c9caf13c 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -19,6 +19,7 @@ using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.SharedModels; +using System.Windows.Data; namespace Flow.Launcher.ViewModel {