From aaad409537f1f875e142f54dcc7956f0c9904ce4 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 20 Nov 2022 19:47:39 +0800 Subject: [PATCH] optimized UI --- clashN/clashN/ViewModels/ProfilesViewModel.cs | 2 +- .../Views/GlobalHotkeySettingWindow.xaml | 7 ++--- clashN/clashN/Views/ProfilesView.xaml.cs | 7 +++++ clashN/clashN/Views/SettingsView.xaml | 26 ++++++++++--------- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/clashN/clashN/ViewModels/ProfilesViewModel.cs b/clashN/clashN/ViewModels/ProfilesViewModel.cs index bbbda04..cb8605a 100644 --- a/clashN/clashN/ViewModels/ProfilesViewModel.cs +++ b/clashN/clashN/ViewModels/ProfilesViewModel.cs @@ -161,7 +161,7 @@ namespace clashN.ViewModels } } - private void EditProfile(bool blNew) + public void EditProfile(bool blNew) { ProfileItem item; if (blNew) diff --git a/clashN/clashN/Views/GlobalHotkeySettingWindow.xaml b/clashN/clashN/Views/GlobalHotkeySettingWindow.xaml index ad49760..7cf28ce 100644 --- a/clashN/clashN/Views/GlobalHotkeySettingWindow.xaml +++ b/clashN/clashN/Views/GlobalHotkeySettingWindow.xaml @@ -25,16 +25,13 @@ materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> - + - + diff --git a/clashN/clashN/Views/ProfilesView.xaml.cs b/clashN/clashN/Views/ProfilesView.xaml.cs index d1e8187..9adfd64 100644 --- a/clashN/clashN/Views/ProfilesView.xaml.cs +++ b/clashN/clashN/Views/ProfilesView.xaml.cs @@ -21,6 +21,7 @@ namespace clashN.Views ViewModel = new ProfilesViewModel(); Locator.CurrentMutable.RegisterLazySingleton(() => ViewModel, typeof(ProfilesViewModel)); + lstProfiles.PreviewMouseDoubleClick += lstProfiles_PreviewMouseDoubleClick; lstProfiles.PreviewMouseLeftButtonDown += LstProfiles_PreviewMouseLeftButtonDown; lstProfiles.MouseMove += LstProfiles_MouseMove; lstProfiles.DragEnter += LstProfiles_DragEnter; @@ -93,6 +94,11 @@ namespace clashN.Views } } + private void lstProfiles_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) + { + ViewModel?.EditProfile(false); + } + #region Drag and Drop private Point startPoint = new Point(); @@ -186,5 +192,6 @@ namespace clashN.Views } #endregion + } } diff --git a/clashN/clashN/Views/SettingsView.xaml b/clashN/clashN/Views/SettingsView.xaml index a557da6..6a9e017 100644 --- a/clashN/clashN/Views/SettingsView.xaml +++ b/clashN/clashN/Views/SettingsView.xaml @@ -58,9 +58,9 @@ DockPanel.Dock="Top" Style="{StaticResource ListItemTitle}" Text="{x:Static resx:ResUI.TbSettingsSaveTip}" /> - - - + + + @@ -205,9 +205,10 @@ Content="{x:Static resx:ResUI.TbSettingsEditMixin}" Style="{StaticResource DefButton}" /> - - - + + + + @@ -350,10 +351,11 @@ Style="{StaticResource DefButton}" /> + + - - - + + @@ -416,9 +418,9 @@ Width="200" Margin="8" /> + + + - - -