From 9edfa3781657eb8f48a1448d5719df2584018dfe Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sun, 4 Dec 2022 02:16:41 -0600 Subject: [PATCH] Remove unused method (and really use EditPluginPriorityCommand) --- Flow.Launcher/SettingWindow.xaml | 2 +- Flow.Launcher/SettingWindow.xaml.cs | 44 ----------------------------- 2 files changed, 1 insertion(+), 45 deletions(-) diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 94b542e2f..f7955dd22 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1127,7 +1127,7 @@ x:Name="PriorityButton" Margin="0,0,22,0" VerticalAlignment="Center" - Click="OnPluginPriorityClick" + Command="{Binding EditPluginPriorityCommand}" Content="{Binding Priority, UpdateSourceTrigger=PropertyChanged}" Cursor="Hand" ToolTip="{DynamicResource priorityToolTip}"> diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 5c06e02e2..b9dbac0f9 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -5,7 +5,6 @@ using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; -using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.ViewModel; using ModernWpf; using ModernWpf.Controls; @@ -18,7 +17,6 @@ using System.Windows.Data; using System.Windows.Forms; using System.Windows.Input; using System.Windows.Interop; -using System.Windows.Media; using System.Windows.Navigation; using Button = System.Windows.Controls.Button; using Control = System.Windows.Controls.Control; @@ -194,32 +192,6 @@ namespace Flow.Launcher } } - private void OnPluginNameClick(object sender, MouseButtonEventArgs e) - { - if (e.ChangedButton == MouseButton.Left) - { - var website = viewModel.SelectedPlugin.PluginPair.Metadata.Website; - if (!string.IsNullOrEmpty(website)) - { - var uri = new Uri(website); - if (Uri.CheckSchemeName(uri.Scheme)) - { - website.OpenInBrowserTab(); - } - } - } - } - - private void OnPluginDirecotyClick(object sender, MouseButtonEventArgs e) - { - if (e.ChangedButton == MouseButton.Left) - { - var directory = viewModel.SelectedPlugin.PluginPair.Metadata.PluginDirectory; - if (!string.IsNullOrEmpty(directory)) - PluginManager.API.OpenDirectory(directory); - } - } - #endregion #region Proxy @@ -290,22 +262,6 @@ namespace Flow.Launcher } } - private static T FindParent(DependencyObject child) where T : DependencyObject - { - //get parent item - DependencyObject parentObject = VisualTreeHelper.GetParent(child); - - //we've reached the end of the tree - if (parentObject == null) return null; - - //check if the parent matches the type we're looking for - T parent = parentObject as T; - if (parent != null) - return parent; - else - return FindParent(parentObject); - } - private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e) { if (sender is not Button { DataContext: PluginStoreItemViewModel plugin } button)