From ee4dc394d409ca20ba206ea5b8dffa0709a60051 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 28 Jul 2025 14:28:55 +0800 Subject: [PATCH] Clear plugin list selection to make sure all items can be mouse hovered --- .../SettingPages/Views/SettingsPanePlugins.xaml | 1 + .../SettingPages/Views/SettingsPanePlugins.xaml.cs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml index 52d77f91418..aa7c219e576 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml @@ -122,6 +122,7 @@ FontSize="14" ItemContainerStyle="{StaticResource PluginList}" ItemsSource="{Binding Source={StaticResource PluginCollectionView}}" + Loaded="PluginListBox_Loaded" ScrollViewer.CanContentScroll="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled" SnapsToDevicePixels="True" diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml.cs b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml.cs index f486a3443ce..e77a30843ea 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml.cs +++ b/Flow.Launcher/SettingPages/Views/SettingsPanePlugins.xaml.cs @@ -1,4 +1,6 @@ using System.ComponentModel; +using System.Windows; +using System.Windows.Controls; using System.Windows.Data; using System.Windows.Input; using System.Windows.Navigation; @@ -33,6 +35,14 @@ protected override void OnNavigatedTo(NavigationEventArgs e) base.OnNavigatedTo(e); } + private void PluginListBox_Loaded(object sender, RoutedEventArgs e) + { + // After list is loaded, we need to clear selection to make sure all items can be mouse hovered + // because the selected item cannot be hovered. + if (sender is not ListBox listBox) return; + listBox.SelectedIndex = -1; + } + private void ViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(SettingsPanePluginsViewModel.FilterText))