From 8958bddb2512d1abbfd913f7f66fcf6fac535d2c Mon Sep 17 00:00:00 2001 From: liufei Date: Mon, 13 Dec 2021 10:53:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=9A=90=E8=97=8F=E6=89=98?= =?UTF-8?q?=E7=9B=98=E5=9B=BE=E6=A0=87=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Control/UserControls/Config/ThemeControl.xaml | 13 ++++++++++++- MainWindow.xaml | 4 +++- MainWindow.xaml.cs | 12 ++++++++++++ ViewModel/AppConfig.cs | 15 +++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Control/UserControls/Config/ThemeControl.xaml b/Control/UserControls/Config/ThemeControl.xaml index 65c12f2..b6f3e36 100644 --- a/Control/UserControls/Config/ThemeControl.xaml +++ b/Control/UserControls/Config/ThemeControl.xaml @@ -17,8 +17,9 @@ - + + + + + + + + + + + diff --git a/MainWindow.xaml b/MainWindow.xaml index 1511c93..affd2ab 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -119,10 +119,12 @@ - + + diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index ff42626..aac0568 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -95,6 +95,8 @@ namespace GeekDesk ShowApp(); } + BarIcon.Text = Constants.MY_NAME; + //注册热键 RegisterHotKey(true); RegisterCreateToDoHotKey(true); @@ -510,6 +512,16 @@ namespace GeekDesk p.Start(); Application.Current.Shutdown(); } + + /// + /// 关闭托盘图标 + /// + /// + /// + private void CloseBarIcon(object sender, RoutedEventArgs e) + { + appData.AppConfig.ShowBarIcon = false; + } } diff --git a/ViewModel/AppConfig.cs b/ViewModel/AppConfig.cs index 6e4766a..fa3a435 100644 --- a/ViewModel/AppConfig.cs +++ b/ViewModel/AppConfig.cs @@ -68,7 +68,22 @@ namespace GeekDesk.ViewModel private bool mouseMiddleShow = false; //鼠标中键呼出 默认不启用 + private bool showBarIcon = true; //显示托盘图标 默认显示 + #region GetSet + public bool ShowBarIcon + { + get + { + return showBarIcon; + } + set + { + showBarIcon = value; + OnPropertyChanged("ShowBarIcon"); + } + } + public bool MouseMiddleShow { get