diff --git a/App.config b/App.config index 544efdc..8705f81 100644 --- a/App.config +++ b/App.config @@ -28,7 +28,7 @@ - + diff --git a/Constant/Constants.cs b/Constant/Constants.cs index eae0885..1cda463 100644 --- a/Constant/Constants.cs +++ b/Constant/Constants.cs @@ -11,7 +11,7 @@ namespace GeekDesk.Constant public static string APP_DIR = AppDomain.CurrentDomain.BaseDirectory.Trim(); // 是否为开发模式 - public static bool DEV = false; + public static bool DEV = true; public static string MY_NAME = DEV ? "GeekDesk-D" : "GeekDesk"; diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs index ec537e4..dbe4646 100644 --- a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs +++ b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs @@ -28,11 +28,11 @@ namespace GeekDesk.Control.UserControls.PannelCard if (appData.AppConfig.SelectedMenuIndex >= appData.MenuList.Count || appData.AppConfig.SelectedMenuIndex == -1) { appData.AppConfig.SelectedMenuIcons = appData.MenuList[0].IconList; - } else + } + else { appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList; } - } DelegateCommand _swap; @@ -207,8 +207,9 @@ namespace GeekDesk.Control.UserControls.PannelCard //设置对应菜单的图标列表 if (MenuListBox.SelectedIndex == -1) { - appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.MenuList.Count-1].IconList; - } else + appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.MenuList.Count - 1].IconList; + } + else { appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList; } diff --git a/Control/Windows/ConfigWindow.xaml b/Control/Windows/ConfigWindow.xaml index 73cd8ad..dc063f5 100644 --- a/Control/Windows/ConfigWindow.xaml +++ b/Control/Windows/ConfigWindow.xaml @@ -15,6 +15,8 @@ AllowsTransparency="True" Background="#00FFFFFF" ShowInTaskbar="False" BorderThickness="0" + Focusable="True" + KeyDown="OnKeyDown" > diff --git a/Control/Windows/ConfigWindow.xaml.cs b/Control/Windows/ConfigWindow.xaml.cs index 915754e..6d334d9 100644 --- a/Control/Windows/ConfigWindow.xaml.cs +++ b/Control/Windows/ConfigWindow.xaml.cs @@ -2,6 +2,7 @@ using GeekDesk.Constant; using GeekDesk.Control.UserControls; using GeekDesk.Control.UserControls.Config; +using GeekDesk.Interface; using GeekDesk.Util; using GeekDesk.ViewModel; using HandyControl.Controls; @@ -15,7 +16,7 @@ namespace GeekDesk.Control.Windows /// /// ConfigDialog.xaml 的交互逻辑 /// - public partial class ConfigWindow + public partial class ConfigWindow : IWindowCommon { private static readonly AboutControl about = new AboutControl(); private static readonly ThemeControl theme = new ThemeControl(); @@ -87,6 +88,15 @@ namespace GeekDesk.Control.Windows window = new ConfigWindow(appConfig, mainWindow); } window.Show(); + Keyboard.Focus(window); + } + + public void OnKeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Escape) + { + this.Close(); + } } } } diff --git a/Control/Windows/IconfontWindow.xaml b/Control/Windows/IconfontWindow.xaml index a6efc33..bb9803f 100644 --- a/Control/Windows/IconfontWindow.xaml +++ b/Control/Windows/IconfontWindow.xaml @@ -14,6 +14,8 @@ AllowsTransparency="True" Background="Transparent" ShowInTaskbar="False" BorderThickness="0" + Focusable="True" + KeyDown="OnKeyDown" > @@ -39,7 +41,7 @@ - + - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + -