From 9cbbd6cf45317933dab9b83363107137ff33550a Mon Sep 17 00:00:00 2001 From: liufei Date: Fri, 27 May 2022 10:48:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E4=BB=BB=E5=8A=A1=E6=A0=8F=E5=9B=BE=E6=A0=87=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=8B=BE=E8=89=B2=E5=99=A8,=20=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=B6=88=E5=A4=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Windows/GlobalColorPickerWindow.xaml.cs | 21 ++++++++++++++----- MainWindow.xaml | 10 ++++----- MainWindow.xaml.cs | 13 ++---------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Control/Windows/GlobalColorPickerWindow.xaml.cs b/Control/Windows/GlobalColorPickerWindow.xaml.cs index 5045abf..80f69ac 100644 --- a/Control/Windows/GlobalColorPickerWindow.xaml.cs +++ b/Control/Windows/GlobalColorPickerWindow.xaml.cs @@ -81,15 +81,25 @@ namespace GeekDesk.Control.Windows if (window == null || !window.Activate()) { window = new GlobalColorPickerWindow(); + window.Opacity = 0; + App.DoEvents(); window.Show(); } window.Hide(); - GlobalColorPickerWindow thisWindow = (GlobalColorPickerWindow)window; - if (thisWindow.colorPickerWindow == null || !thisWindow.colorPickerWindow.Activate()) + new Thread(() => { - thisWindow.colorPickerWindow = new PixelColorPickerWindow(thisWindow.MyColorPicker); - } - thisWindow.colorPickerWindow.Show(); + Thread.Sleep(200); + App.Current.Dispatcher.Invoke(() => + { + GlobalColorPickerWindow thisWindow = (GlobalColorPickerWindow)window; + if (thisWindow.colorPickerWindow == null || !thisWindow.colorPickerWindow.Activate()) + { + thisWindow.colorPickerWindow = new PixelColorPickerWindow(thisWindow.MyColorPicker); + } + thisWindow.colorPickerWindow.Show(); + }); + }).Start(); + } public static void Show() @@ -98,6 +108,7 @@ namespace GeekDesk.Control.Windows { window = new GlobalColorPickerWindow(); } + window.Opacity = 1; window.Show(); Keyboard.Focus(window); } diff --git a/MainWindow.xaml b/MainWindow.xaml index 1a8c2bd..ba1da4e 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -141,11 +141,9 @@ TextChanged="SearchBox_TextChanged" /> - - + @@ -158,8 +156,10 @@ - + + + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index a5ffd4a..f4cd8b4 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -718,20 +718,10 @@ namespace GeekDesk /// private void ColorPicker(object sender, RoutedEventArgs e) { - TaskbarContextMenu.Visibility = Visibility.Collapsed; - App.DoEvents(); + TaskbarContextMenu.IsOpen = false; GlobalColorPickerWindow.CreateNoShow(); } - /// - /// 防止点击拾色器后无法显示菜单的问题 - /// - /// - /// - private void BarIcon_MouseRightButtonDown(object sender, MouseButtonEventArgs e) - { - TaskbarContextMenu.Visibility = Visibility.Visible; - } private void Window_GotFocus(object sender, RoutedEventArgs e) { @@ -742,5 +732,6 @@ namespace GeekDesk { AppWindowLostFocus(); } + } } From f56991410b516365fb3f6b16524e55447264d1e1 Mon Sep 17 00:00:00 2001 From: liufei Date: Fri, 27 May 2022 11:19:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BF=AE=E6=94=B9=E8=8F=9C=E5=8D=95=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/PannelCard/LeftCardControl.xaml.cs | 7 +++++-- MainWindow.xaml | 2 +- MainWindow.xaml.cs | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs index 53fa4ba..09e5793 100644 --- a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs +++ b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs @@ -25,7 +25,7 @@ namespace GeekDesk.Control.UserControls.PannelCard //是否正在修改菜单 - private static bool IS_EDIT = false; + public bool IS_EDIT = false; public LeftCardControl() { @@ -205,9 +205,9 @@ namespace GeekDesk.Control.UserControls.PannelCard /// private void RenameMenu(object sender, RoutedEventArgs e) { + IS_EDIT = true; MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo; menuInfo.MenuEdit = (int)Visibility.Visible; - IS_EDIT = true; } /// @@ -276,6 +276,8 @@ namespace GeekDesk.Control.UserControls.PannelCard menuInfo.MenuEdit = Visibility.Collapsed; } IS_EDIT = false; + //为了解决无法修改菜单的问题 + MainWindow.mainWindow.SearchBox.Focus(); MenuListBox.SelectedIndex = menuSelectIndexTemp; } } @@ -309,6 +311,7 @@ namespace GeekDesk.Control.UserControls.PannelCard private void Menu_SelectionChanged(object sender, SelectionChangedEventArgs e) { + if (IS_EDIT) return; //设置对应菜单的图标列表 if (MenuListBox.SelectedIndex == -1) { diff --git a/MainWindow.xaml b/MainWindow.xaml index ba1da4e..1f8733d 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -125,7 +125,7 @@ - + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index f4cd8b4..fa95683 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -1,5 +1,6 @@ using GeekDesk.Constant; using GeekDesk.Control.UserControls.Config; +using GeekDesk.Control.UserControls.PannelCard; using GeekDesk.Control.Windows; using GeekDesk.Interface; using GeekDesk.MyThread; @@ -725,7 +726,11 @@ namespace GeekDesk private void Window_GotFocus(object sender, RoutedEventArgs e) { - Keyboard.Focus(SearchBox); + if (!LeftCard.IS_EDIT) + { + //if判断是为了能够使修改菜单时 菜单能够获得焦点 + Keyboard.Focus(SearchBox); + } } private void AppWindow_Deactivated(object sender, EventArgs e) From f868eb77b6c78e72c6717f06bc0eee37be6f3edf Mon Sep 17 00:00:00 2001 From: liufei Date: Fri, 27 May 2022 14:55:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?2.4.16=20=E8=A1=A5=E4=B8=81=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.config | 2 +- Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/App.config b/App.config index 66892cf..617ade3 100644 --- a/App.config +++ b/App.config @@ -49,7 +49,7 @@ - + diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index c6a79cd..afc1cf3 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ using System.Windows; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.4.1.5")] -[assembly: AssemblyFileVersion("2.4.1.5")] +[assembly: AssemblyVersion("2.4.1.6")] +[assembly: AssemblyFileVersion("2.4.1.6")]