diff --git a/App.config b/App.config index 3b70a2d..4a166e8 100644 --- a/App.config +++ b/App.config @@ -33,7 +33,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/App.xaml.cs b/App.xaml.cs index 3d92836..1701231 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -54,7 +54,7 @@ namespace GeekDesk void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { LogUtil.WriteErrorLog(e, "严重异常!"); - MessageBox.Show("GeekDesk遇到未知问题崩溃!"); + //MessageBox.Show("GeekDesk遇到未知问题崩溃!"); } public static void DoEvents() { diff --git a/Constant/Constants.cs b/Constant/Constants.cs index 37c8ddb..95e22be 100644 --- a/Constant/Constants.cs +++ b/Constant/Constants.cs @@ -26,6 +26,8 @@ namespace GeekDesk.Constant public static string PW_FILE_BAK_PATH = APP_DIR + "bak\\pw.txt"; //密码文件路径 + public static string UUID_FILE_BAK_PATH = APP_DIR + "bak\\uuid.txt"; //密码文件路径 + public static string LOG_FILE_PATH = APP_DIR + "logs\\log.log"; //日志文件 public static string ERROR_FILE_PATH = APP_DIR + "logs\\error.log"; // 错误日志 diff --git a/Constant/MenuType.cs b/Constant/MenuType.cs new file mode 100644 index 0000000..23ebc97 --- /dev/null +++ b/Constant/MenuType.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace GeekDesk.Constant +{ + public enum MenuType + { + NORMAL, //普通菜单 + LINK, //关联菜单 + } +} diff --git a/Constant/RunTimeStatus.cs b/Constant/RunTimeStatus.cs index ffb5b27..e4b2914 100644 --- a/Constant/RunTimeStatus.cs +++ b/Constant/RunTimeStatus.cs @@ -1,4 +1,6 @@ -namespace GeekDesk.Constant +using System; + +namespace GeekDesk.Constant { internal class RunTimeStatus { @@ -6,57 +8,83 @@ /// /// 查询框是否在工作 /// - public static bool SEARCH_BOX_SHOW = false; + public static volatile bool SEARCH_BOX_SHOW = false; + + /// + /// 查询框是否已经关闭了300毫秒 防止点击右侧区域关闭查询框时误打开列表 + /// + public static volatile bool SEARCH_BOX_HIDED_300 = true; /// /// 贴边隐藏后 以非鼠标经过方式触发显示 /// - public static bool MARGIN_HIDE_AND_OTHER_SHOW = false; + public static volatile bool MARGIN_HIDE_AND_OTHER_SHOW = false; /// /// 是否锁定主面板 锁定后 不执行隐藏动作 /// - public static bool LOCK_APP_PANEL = false; + public static volatile bool LOCK_APP_PANEL = false; /// /// 是否弹出了菜单密码框 /// - public static bool SHOW_MENU_PASSWORDBOX = false; + public static volatile bool SHOW_MENU_PASSWORDBOX = false; /// /// 是否弹出了右键菜单 /// - public static bool SHOW_RIGHT_BTN_MENU = false; + public static volatile bool SHOW_RIGHT_BTN_MENU = false; /// /// 是否点击了面板功能按钮 /// - public static bool APP_BTN_IS_DOWN = false; + public static volatile bool APP_BTN_IS_DOWN = false; /// /// 是否正在编辑菜单 /// - public static bool IS_MENU_EDIT = false; + public static volatile bool IS_MENU_EDIT = false; /// /// 图标card 鼠标滚轮是否正在工作 /// 用来控制popup的显示 否则低性能机器会造成卡顿 /// - public static bool ICONLIST_MOUSE_WHEEL = false; + public static volatile bool ICONLIST_MOUSE_WHEEL = false; /// /// 控制多少毫秒后 关闭(ICONLIST_MOUSE_WHEEL)鼠标滚轮运行状态 /// - public static int MOUSE_WHEEL_WAIT_MS = 100; + public static volatile int MOUSE_WHEEL_WAIT_MS = 100; /// /// 与关闭popup 配合使用, 避免线程结束后不显示popup /// - public static bool MOUSE_ENTER_ICON = false; + public static volatile bool MOUSE_ENTER_ICON = false; /// /// 控制每次刷新搜索结果 鼠标移动后显示popup /// - public static int MOUSE_MOVE_COUNT = 0; + public static volatile int MOUSE_MOVE_COUNT = 0; + + + /// + /// everything 新的键入搜索 + /// + public static volatile bool EVERYTHING_NEW_SEARCH = false; + + /// + /// 键入多少毫秒后 没有新的键入开启搜索 + /// + public static volatile int EVERYTHING_SEARCH_DELAY_TIME = 300; + + /// + /// 控制主界面热键按下规定时间内只执行一次show hide + /// + public static volatile bool MAIN_HOT_KEY_DOWN = false; + /// + /// 控制主界面热键按下规定时间内只执行一次show hide + /// + public static volatile int MAIN_HOT_KEY_TIME = 300; + } } diff --git a/Constant/WidthTypeEnum.cs b/Constant/WidthTypeEnum.cs index 0c032f8..b9e0bfa 100644 --- a/Constant/WidthTypeEnum.cs +++ b/Constant/WidthTypeEnum.cs @@ -10,6 +10,10 @@ namespace GeekDesk.Constant { LEFT_CARD = 0, //左侧托盘宽度 RIGHT_CARD = 1, //右侧托盘宽度 - RIGHT_CARD_HALF = 2 //右侧托盘宽度的一半 + RIGHT_CARD_HALF = 2, //右侧托盘宽度的一半 + RIGHT_CARD_HALF_TEXT = 3, //右侧托盘宽度的一半 再减去左侧图像宽度 + RIGHT_CARD_20 = 4, //右侧托盘宽度 - 20 + RIGHT_CARD_40 = 5, //右侧托盘宽度 - 40 + RIGHT_CARD_70 = 6, //右侧托盘宽度 - 70 } } diff --git a/Control/Other/BacklogNotificatin.xaml b/Control/Other/BacklogNotificatin.xaml index 5b63d8d..30e7db7 100644 --- a/Control/Other/BacklogNotificatin.xaml +++ b/Control/Other/BacklogNotificatin.xaml @@ -37,17 +37,17 @@ - + - + + + - - - + + - + + diff --git a/Control/Windows/GlobalColorPickerWindow.xaml.cs b/Control/Windows/GlobalColorPickerWindow.xaml.cs index 80f69ac..65a3a7a 100644 --- a/Control/Windows/GlobalColorPickerWindow.xaml.cs +++ b/Control/Windows/GlobalColorPickerWindow.xaml.cs @@ -1,5 +1,8 @@ using GeekDesk.Interface; +using GeekDesk.Util; using System; +using System.Collections.ObjectModel; +using System.ComponentModel; using System.Threading; using System.Windows; using System.Windows.Controls; @@ -14,10 +17,33 @@ namespace GeekDesk.Control.Windows public partial class GlobalColorPickerWindow : IWindowCommon { PixelColorPickerWindow colorPickerWindow = null; + + class PrivateDataContext : INotifyPropertyChanged + { + private bool copyAnimation = false; + + public bool CopyAnimation + { + set + { + copyAnimation = value; + OnPropertyChanged("CopyAnimation"); + + } + get { return copyAnimation; } + } + + public event PropertyChangedEventHandler PropertyChanged; + private void OnPropertyChanged(string propertyName) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } public GlobalColorPickerWindow() { this.Topmost = true; InitializeComponent(); + this.DataContext = new PrivateDataContext(); } public void OnKeyDown(object sender, KeyEventArgs e) @@ -35,14 +61,26 @@ namespace GeekDesk.Control.Windows /// /// /// - private void MyColorPicker_Canceled(object sender, EventArgs e) + private void MyColorPicker_Canceled(object sender, RoutedEventArgs e) { MyColorPickerClose(); } - private void MyColorPicker_Confirmed(object sender, HandyControl.Data.FunctionEventArgs e) + private void MyColorPicker_Confirmed(object sender, RoutedEventArgs e) { + CopySuccess.Visibility = Visibility.Visible; + PrivateDataContext pdc = this.DataContext as PrivateDataContext; + pdc.CopyAnimation = true; + new Thread(() => + { + Thread.Sleep(400); + this.Dispatcher.Invoke(() => + { + pdc.CopyAnimation = false; + CopySuccess.Visibility = Visibility.Collapsed; + }); + }).Start(); Color c = MyColorPicker.SelectedBrush.Color; - Clipboard.SetData(DataFormats.Text, string.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", c.A, c.R, c.G, c.B)); + Clipboard.SetData(DataFormats.Text, string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B)); } /// @@ -148,5 +186,28 @@ namespace GeekDesk.Control.Windows { this.Close(); } + + private ICommand _hideCommand; + public ICommand HideCommand + { + get + { + if (_hideCommand == null) + { + _hideCommand = new RelayCommand( + p => + { + return true; + }, + p => + { + //CopySuccess.Visibility = Visibility.Collapsed; + }); + } + return _hideCommand; + } + } + + } } diff --git a/Control/Windows/IconfontWindow.xaml b/Control/Windows/IconfontWindow.xaml index bb9803f..55dde69 100644 --- a/Control/Windows/IconfontWindow.xaml +++ b/Control/Windows/IconfontWindow.xaml @@ -51,7 +51,7 @@ --> - + -