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/Other/CustomIconUrlDialog.xaml b/Control/Other/CustomIconUrlDialog.xaml
index 512a8dc..e384a0e 100644
--- a/Control/Other/CustomIconUrlDialog.xaml
+++ b/Control/Other/CustomIconUrlDialog.xaml
@@ -23,7 +23,7 @@
-
+
@@ -31,18 +31,18 @@
-
+
-
+ Style="{StaticResource MyBtnStyle}"/>
+ Style="{StaticResource MyBtnStyle}"/>
diff --git a/Control/Other/GlobalMsgNotification.xaml b/Control/Other/GlobalMsgNotification.xaml
index c421ea3..73084f4 100644
--- a/Control/Other/GlobalMsgNotification.xaml
+++ b/Control/Other/GlobalMsgNotification.xaml
@@ -49,6 +49,6 @@
-
+
diff --git a/Control/Other/GradientBGDialog.xaml b/Control/Other/GradientBGDialog.xaml
index 8e9bb3f..3f2bd22 100644
--- a/Control/Other/GradientBGDialog.xaml
+++ b/Control/Other/GradientBGDialog.xaml
@@ -63,7 +63,7 @@
-
+
diff --git a/Control/Other/IconInfoDialog.xaml b/Control/Other/IconInfoDialog.xaml
index f094620..5b00a37 100644
--- a/Control/Other/IconInfoDialog.xaml
+++ b/Control/Other/IconInfoDialog.xaml
@@ -24,7 +24,7 @@
-
+
@@ -40,24 +40,19 @@
-
-
+
+
-
-
-
-
-
-
-
+
-
+
-
+
diff --git a/Control/Other/IconInfoUrlDialog.xaml b/Control/Other/IconInfoUrlDialog.xaml
index e585641..b2939c3 100644
--- a/Control/Other/IconInfoUrlDialog.xaml
+++ b/Control/Other/IconInfoUrlDialog.xaml
@@ -23,23 +23,23 @@
-
+
-
+
-
-
+
+
-
+
diff --git a/Control/Other/MyColorPickerDialog.xaml.cs b/Control/Other/MyColorPickerDialog.xaml.cs
index f1075b2..9fb4839 100644
--- a/Control/Other/MyColorPickerDialog.xaml.cs
+++ b/Control/Other/MyColorPickerDialog.xaml.cs
@@ -1,4 +1,5 @@
using GeekDesk.Control.Windows;
+using GeekDesk.Util;
using GeekDesk.ViewModel;
using System;
using System.Reflection;
@@ -64,14 +65,15 @@ namespace GeekDesk.Control.Other
private void MyColorPicker_SelectedColorChanged(object sender, HandyControl.Data.FunctionEventArgs e)
{
SolidColorBrush scb = MyColorPicker.SelectedBrush;
+ Color c = scb.Color;
switch (colorType)
{
case ColorType.COLOR_1:
- appConfig.GradientBGParam.Color1 = scb.ToString(); break;
+ appConfig.GradientBGParam.Color1 = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break;
case ColorType.COLOR_2:
- appConfig.GradientBGParam.Color2 = scb.ToString(); break;
+ appConfig.GradientBGParam.Color2 = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break;
default:
- appConfig.TextColor = scb.ToString(); break;
+ appConfig.TextColor = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B); break;
}
}
diff --git a/Control/Other/PasswordDialog.xaml b/Control/Other/PasswordDialog.xaml
index 39dca05..3813ba0 100644
--- a/Control/Other/PasswordDialog.xaml
+++ b/Control/Other/PasswordDialog.xaml
@@ -64,7 +64,7 @@
-
+
diff --git a/Control/Other/PasswordDialog.xaml.cs b/Control/Other/PasswordDialog.xaml.cs
index c6139ac..76c8457 100644
--- a/Control/Other/PasswordDialog.xaml.cs
+++ b/Control/Other/PasswordDialog.xaml.cs
@@ -105,6 +105,7 @@ namespace GeekDesk.Control.Other
if (!string.IsNullOrEmpty(appData.AppConfig.PasswordHint))
{
//显示提示信息
+ HintMsg.Text = "提示: " + appData.AppConfig.PasswordHint;
HintMsg.Visibility = Visibility.Visible;
}
}
@@ -169,25 +170,33 @@ namespace GeekDesk.Control.Other
new Thread(() =>
{
Thread.Sleep(time);
- Dispatcher.Invoke(() =>
+ try
{
- if (string.IsNullOrEmpty(P1.Password))
+ Dispatcher.Invoke(() =>
{
- P1.Focus();
- return;
- }
- if (string.IsNullOrEmpty(P2.Password))
- {
- P2.Focus();
- return;
- }
- if (string.IsNullOrEmpty(P3.Password))
- {
- P3.Focus();
- return;
- }
- P4.Focus();
- });
+ try
+ {
+ if (string.IsNullOrEmpty(P1.Password))
+ {
+ P1.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(P2.Password))
+ {
+ P2.Focus();
+ return;
+ }
+ if (string.IsNullOrEmpty(P3.Password))
+ {
+ P3.Focus();
+ return;
+ }
+ P4.Focus();
+ }
+ catch (Exception ex) { }
+ });
+ }
+ catch (Exception e2) { }
}).Start();
}
diff --git a/Control/Other/SearchResControl.xaml b/Control/Other/SearchResControl.xaml
new file mode 100644
index 0000000..659930f
--- /dev/null
+++ b/Control/Other/SearchResControl.xaml
@@ -0,0 +1,196 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Control/Other/SearchResControl.xaml.cs b/Control/Other/SearchResControl.xaml.cs
new file mode 100644
index 0000000..ecdd3f6
--- /dev/null
+++ b/Control/Other/SearchResControl.xaml.cs
@@ -0,0 +1,331 @@
+using GeekDesk.Constant;
+using GeekDesk.Control.Windows;
+using GeekDesk.Plugins.EveryThing;
+using GeekDesk.Util;
+using GeekDesk.ViewModel;
+using GeekDesk.ViewModel.Temp;
+using HandyControl.Controls;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+
+namespace GeekDesk.Control.Other
+{
+ ///
+ /// SearchResControl.xaml 的交互逻辑
+ ///
+ public partial class SearchResControl : UserControl
+ {
+ public SearchResControl(ObservableCollection iconList)
+ {
+ this.DataContext = iconList;
+ InitializeComponent();
+ }
+
+
+
+ public void SearchListBoxIndexAdd()
+ {
+ //控制移动后 鼠标即使在图标上也不显示popup
+ RunTimeStatus.MOUSE_MOVE_COUNT = 0;
+ MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false;
+
+ if (SearchListBox.Items.Count > 0)
+ {
+ if (SearchListBox.SelectedIndex < SearchListBox.Items.Count - 1)
+ {
+ SearchListBox.SelectedIndex += 1;
+ }
+ }
+ }
+
+ public void SearchListBoxIndexSub()
+ {
+ //控制移动后 鼠标即使在图标上也不显示popup
+ RunTimeStatus.MOUSE_MOVE_COUNT = 0;
+ MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false;
+
+ if (SearchListBox.Items.Count > 0)
+ {
+ if (SearchListBox.SelectedIndex > 0)
+ {
+ SearchListBox.SelectedIndex -= 1;
+ }
+ }
+ }
+
+ public void StartupSelectionItem()
+ {
+ if (SearchListBox.SelectedItem != null)
+ {
+ IconInfo icon = SearchListBox.SelectedItem as IconInfo;
+ if (icon.AdminStartUp)
+ {
+ ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
+ }
+ else
+ {
+ ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
+ }
+ }
+ }
+
+ private void SearchListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ SearchListBox.ScrollIntoView(SearchListBox.SelectedItem);
+ }
+
+
+
+ ///
+ /// 查询结果ICON鼠标移动事件
+ ///
+ ///
+ ///
+ private void SearchIcon_MouseMove(object sender, MouseEventArgs e)
+ {
+ //控制首次刷新搜索结果后, 鼠标首次移动后显示popup
+ RunTimeStatus.MOUSE_MOVE_COUNT++;
+
+ //防止移动后不刷新popup content
+ IconInfo info = (sender as Panel).Tag as IconInfo;
+ MainWindow.mainWindow.RightCard.MyPoptipContent.Text = info.Content;
+ MainWindow.mainWindow.RightCard.MyPoptip.VerticalOffset = 30;
+
+ if (RunTimeStatus.MOUSE_MOVE_COUNT > 1 && !RunTimeStatus.ICONLIST_MOUSE_WHEEL)
+ {
+ MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true;
+ }
+ }
+
+ ///
+ /// 查询结果 ICON 鼠标进入事件
+ ///
+ ///
+ ///
+ private void SearchIcon_MouseEnter(object sender, MouseEventArgs e)
+ {
+
+ //显示popup
+ RunTimeStatus.MOUSE_ENTER_ICON = true;
+ if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL)
+ {
+ new Thread(() =>
+ {
+ this.Dispatcher.BeginInvoke(new Action(() =>
+ {
+ IconInfo info = (sender as Panel).Tag as IconInfo;
+ MainWindow.mainWindow.RightCard.MyPoptipContent.Text = info.Content;
+ MainWindow.mainWindow.RightCard.MyPoptip.VerticalOffset = 30;
+ Thread.Sleep(100);
+ if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL && RunTimeStatus.MOUSE_MOVE_COUNT > 1)
+ {
+ MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true;
+ }
+ }));
+ }).Start();
+ }
+ }
+
+ ///
+ /// 查询结果ICON鼠标离开事件
+ ///
+ ///
+ ///
+ private void SearchIcon_MouseLeave(object sender, MouseEventArgs e)
+ {
+ RunTimeStatus.MOUSE_ENTER_ICON = false;
+ MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false;
+ }
+
+ ///
+ /// 搜索结果icon 列表鼠标滚轮预处理时间
+ /// 主要使用自定义popup解决卡顿问题解决卡顿问题
+ ///
+ ///
+ ///
+ private void VerticalIconList_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
+ {
+ //控制在滚动时不显示popup 否则会在低GPU性能机器上造成卡顿
+ MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = false;
+ if (RunTimeStatus.ICONLIST_MOUSE_WHEEL)
+ {
+ RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 500;
+ }
+ else
+ {
+ RunTimeStatus.ICONLIST_MOUSE_WHEEL = true;
+
+ new Thread(() =>
+ {
+ while (RunTimeStatus.MOUSE_WHEEL_WAIT_MS > 0)
+ {
+ Thread.Sleep(1);
+ RunTimeStatus.MOUSE_WHEEL_WAIT_MS -= 1;
+ }
+ if (RunTimeStatus.MOUSE_ENTER_ICON)
+ {
+ this.Dispatcher.BeginInvoke(new Action(() =>
+ {
+ MainWindow.mainWindow.RightCard.MyPoptip.IsOpen = true;
+ }));
+ }
+ RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 100;
+ RunTimeStatus.ICONLIST_MOUSE_WHEEL = false;
+ }).Start();
+ }
+ }
+
+
+ private void Icon_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ if (MainWindow.appData.AppConfig.DoubleOpen)
+ {
+ IconClick(sender, e);
+ }
+ }
+
+ private void Icon_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ if (!MainWindow.appData.AppConfig.DoubleOpen)
+ {
+ IconClick(sender, e);
+ }
+ }
+
+ ///
+ /// 图标点击事件
+ ///
+ ///
+ ///
+ private void IconClick(object sender, MouseButtonEventArgs e)
+ {
+ if (MainWindow.appData.AppConfig.DoubleOpen && e.ClickCount >= 2)
+ {
+ IconInfo icon = (IconInfo)((Panel)sender).Tag;
+ if (icon.AdminStartUp)
+ {
+ ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
+ }
+ else
+ {
+ ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
+ }
+ }
+ else if (!MainWindow.appData.AppConfig.DoubleOpen && e.ClickCount == 1)
+ {
+ IconInfo icon = (IconInfo)((Panel)sender).Tag;
+ if (icon.AdminStartUp)
+ {
+ ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
+ }
+ else
+ {
+ ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
+ }
+ }
+
+ }
+
+
+ private static volatile bool EveryThingRuning = false;
+ private void VerticalCard_ScrollChanged(object sender, ScrollChangedEventArgs e)
+ {
+ if (MainWindow.appData.AppConfig.EnableEveryThing == true && EveryThingUtil.HasNext())
+ {
+ HandyControl.Controls.ScrollViewer sv = sender as HandyControl.Controls.ScrollViewer;
+ if (sv.ExtentHeight - (sv.ActualHeight + sv.VerticalOffset) < 100
+ && EveryThingUtil.HasNext()
+ && !EveryThingRuning)
+ {
+ EveryThingRuning = true;
+ MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Visible;
+ int everyThingCount = Convert.ToInt32(MainWindow.mainWindow.EverythingSearchCount.Text);
+
+ ObservableCollection resList = this.DataContext as ObservableCollection;
+
+ ThreadPool.QueueUserWorkItem(state =>
+ {
+ ObservableCollection searchRes = EveryThingUtil.NextPage();
+ this.Dispatcher.Invoke(() =>
+ {
+ everyThingCount += searchRes.Count;
+ MainWindow.mainWindow.EverythingSearchCount.Text = Convert.ToString(everyThingCount);
+ foreach (IconInfo info in searchRes)
+ {
+ resList.Add(info);
+ }
+ MainWindow.mainWindow.RightCard.Loading_RightCard.Visibility = Visibility.Collapsed;
+ EveryThingRuning = false;
+ });
+ });
+
+ }
+ }
+ }
+
+
+
+
+
+
+
+ ///
+ /// 管理员方式启动
+ ///
+ ///
+ ///
+ private void IconAdminStart(object sender, RoutedEventArgs e)
+ {
+ IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
+ ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
+ }
+
+ ///
+ /// 打开文件所在位置
+ ///
+ ///
+ ///
+ private void ShowInExplore(object sender, RoutedEventArgs e)
+ {
+ IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
+ ProcessUtil.StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
+ }
+
+
+ private void SystemContextMenu(object sender, RoutedEventArgs e)
+ {
+ IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
+ DirectoryInfo[] folders = new DirectoryInfo[1];
+ folders[0] = new DirectoryInfo(icon.Path);
+ ShellContextMenu scm = new ShellContextMenu();
+ System.Drawing.Point p = System.Windows.Forms.Cursor.Position;
+ p.X -= 80;
+ p.Y -= 80;
+ scm.ShowContextMenu(folders, p);
+ }
+
+
+
+
+
+
+
+
+
+ }
+}
diff --git a/Control/UserControls/Config/AboutControl.xaml b/Control/UserControls/Config/AboutControl.xaml
index daf2a5f..4bfd041 100644
--- a/Control/UserControls/Config/AboutControl.xaml
+++ b/Control/UserControls/Config/AboutControl.xaml
@@ -48,10 +48,11 @@
-
+
+
@@ -79,10 +80,10 @@
diff --git a/Control/UserControls/Config/MotionControl.xaml b/Control/UserControls/Config/MotionControl.xaml
index cd272b5..bf2861a 100644
--- a/Control/UserControls/Config/MotionControl.xaml
+++ b/Control/UserControls/Config/MotionControl.xaml
@@ -25,63 +25,36 @@
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
@@ -90,27 +63,35 @@
-
-
-
-
+
-
-
+
+
@@ -119,6 +100,7 @@
+
-
-
-
-
-
-
+ IsChecked="{Binding EnableAppHotKey}"/>
+
-
-
-
-
-
-
+ IsChecked="{Binding EnableTodoHotKey}"/>
-
-
-
-
-
-
+ IsChecked="{Binding EnableColorPickerHotKey}"/>
diff --git a/Control/UserControls/Config/OtherControl.xaml b/Control/UserControls/Config/OtherControl.xaml
index 4ddb204..91b630c 100644
--- a/Control/UserControls/Config/OtherControl.xaml
+++ b/Control/UserControls/Config/OtherControl.xaml
@@ -20,75 +20,71 @@
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
+
-
-
-
-
-
@@ -96,14 +92,14 @@
-
-
@@ -112,9 +108,9 @@
diff --git a/Control/UserControls/Config/OtherControl.xaml.cs b/Control/UserControls/Config/OtherControl.xaml.cs
index 8f8a80c..2e95c18 100644
--- a/Control/UserControls/Config/OtherControl.xaml.cs
+++ b/Control/UserControls/Config/OtherControl.xaml.cs
@@ -1,5 +1,6 @@
using GeekDesk.Constant;
using GeekDesk.MyThread;
+using GeekDesk.Plugins.EveryThing;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using ShowSeconds;
@@ -186,7 +187,20 @@ namespace GeekDesk.Control.UserControls.Config
catch (Exception ex) { }
}
-
-
+ ///
+ /// EveryThing插件开关
+ ///
+ ///
+ ///
+ private void EveryThing_Changed(object sender, RoutedEventArgs e)
+ {
+ if (MainWindow.appData.AppConfig.EnableEveryThing == true)
+ {
+ EveryThingUtil.EnableEveryThing(0);
+ } else
+ {
+ EveryThingUtil.DisableEveryThing(true);
+ }
+ }
}
}
diff --git a/Control/UserControls/Config/ThemeControl.xaml b/Control/UserControls/Config/ThemeControl.xaml
index 0159ffc..2ac84e5 100644
--- a/Control/UserControls/Config/ThemeControl.xaml
+++ b/Control/UserControls/Config/ThemeControl.xaml
@@ -24,11 +24,11 @@
-
-
@@ -49,18 +49,12 @@
hc:Poptip.Content="{Binding BacImgName}"
hc:Poptip.Placement="TopLeft"
/>
-
-
+
+
-
-
-
-
-
-
-
+
@@ -82,7 +76,10 @@
Margin="0,5,0,0"
VerticalAlignment="Center"
/>
-
+
@@ -92,10 +89,15 @@
Margin="0,5,0,0"
VerticalAlignment="Center"
/>
-
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
@@ -232,7 +217,7 @@
-
+
diff --git a/Control/UserControls/Config/ThemeControl.xaml.cs b/Control/UserControls/Config/ThemeControl.xaml.cs
index 1f6ccad..64c3f66 100644
--- a/Control/UserControls/Config/ThemeControl.xaml.cs
+++ b/Control/UserControls/Config/ThemeControl.xaml.cs
@@ -49,7 +49,7 @@ namespace GeekDesk.Control.UserControls.Config
OpenFileDialog ofd = new OpenFileDialog
{
Multiselect = false, //只允许选中单个文件
- Filter = "图像文件(*.png, *.jpg)|*.png;*.jpg;*.gif"
+ Filter = "图像文件(*.png, *.jpg, *.gif)|*.png;*.jpg;*.gif"
};
if (ofd.ShowDialog() == true)
{
@@ -167,6 +167,6 @@ namespace GeekDesk.Control.UserControls.Config
}
appConfig.IsShow = null;
}
-
+
}
}
diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml b/Control/UserControls/PannelCard/LeftCardControl.xaml
index 4d2a4df..6d91bd2 100644
--- a/Control/UserControls/PannelCard/LeftCardControl.xaml
+++ b/Control/UserControls/PannelCard/LeftCardControl.xaml
@@ -139,6 +139,7 @@
+
@@ -158,6 +159,7 @@
+
@@ -184,7 +186,7 @@
-
+ Visibility="{Binding MenuEdit}">
+
+
+
+
diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
index 6a8a89d..555a25e 100644
--- a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
+++ b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
@@ -4,14 +4,19 @@ using GeekDesk.Control.Other;
using GeekDesk.Control.Windows;
using GeekDesk.Util;
using GeekDesk.ViewModel;
+using Microsoft.Win32;
using System;
using System.Collections.ObjectModel;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
+using System.Windows.Threading;
+using WindowsAPICodePack.Dialogs;
namespace GeekDesk.Control.UserControls.PannelCard
{
@@ -22,13 +27,14 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
private int menuSelectIndexTemp = -1;
private AppData appData = MainWindow.appData;
- private SolidColorBrush bac = new SolidColorBrush(Color.FromRgb(236, 236, 236));
+ private SolidColorBrush bac = new SolidColorBrush(Color.FromRgb(255, 255, 255));
+
public LeftCardControl()
{
InitializeComponent();
-
+ bac.Opacity = 0.6;
this.Loaded += (s, e) =>
{
@@ -200,6 +206,77 @@ namespace GeekDesk.Control.UserControls.PannelCard
Lbi_Selected(obj, null);
}
+ ///
+ /// 创建实时文件菜单
+ ///
+ ///
+ ///
+ private void CreateLinkMenu(object sender, RoutedEventArgs e)
+ {
+ try
+ {
+ CommonOpenFileDialog dialog = new CommonOpenFileDialog
+ {
+ IsFolderPicker = true,
+ Title = "选择关联文件夹"
+ };
+ if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
+ {
+ string menuId = System.Guid.NewGuid().ToString();
+
+ string path = dialog.FileName;
+
+ MenuInfo menuInfo = new MenuInfo
+ {
+ MenuName = Path.GetFileNameWithoutExtension(path),
+ MenuId = menuId,
+ MenuType = MenuType.LINK,
+ LinkPath = path,
+ IsEncrypt = false,
+ };
+
+ appData.MenuList.Add(menuInfo);
+
+ MenuListBox.SelectedIndex = appData.MenuList.Count - 1;
+ appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
+ appData.AppConfig.SelectedMenuIcons = menuInfo.IconList;
+ //首次触发不了Selected事件
+ object obj = MenuListBox.ItemContainerGenerator.ContainerFromIndex(MenuListBox.SelectedIndex);
+ SetListBoxItemEvent((ListBoxItem)obj);
+ Lbi_Selected(obj, null);
+ HandyControl.Controls.Growl.Success("菜单关联成功, 加载列表中, 稍后重新进入此菜单可查看列表!", "MainWindowGrowl");
+ FileWatcher.LinkMenuWatcher(menuInfo);
+
+ new Thread(() =>
+ {
+ DirectoryInfo dirInfo = new DirectoryInfo(menuInfo.LinkPath);
+ FileSystemInfo[] fileInfos = dirInfo.GetFileSystemInfos();
+
+ ObservableCollection iconList = new ObservableCollection();
+ foreach (FileSystemInfo fileInfo in fileInfos)
+ {
+ IconInfo iconInfo = CommonCode.GetIconInfoByPath_NoWrite(fileInfo.FullName);
+ iconList.Add(iconInfo);
+ }
+ this.Dispatcher.Invoke(() =>
+ {
+ menuInfo.IconList = iconList;
+ //foreach (IconInfo iconInfo in iconList)
+ //{
+ // menuInfo.IconList = iconList;
+ //}
+ });
+ }).Start();
+
+ }
+ }
+ catch (Exception ex)
+ {
+ LogUtil.WriteErrorLog(ex, "新建关联菜单失败!");
+ HandyControl.Controls.Growl.WarningGlobal("新建关联菜单失败!");
+ }
+ }
+
///
/// 重命名菜单 将textbox 设置为可见
@@ -220,7 +297,26 @@ namespace GeekDesk.Control.UserControls.PannelCard
///
private void DeleteMenu(object sender, RoutedEventArgs e)
{
+
MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
+ if (menuInfo.IconList != null && menuInfo.IconList.Count > 0)
+ {
+ HandyControl.Controls.Growl.Ask("确认删除此菜单吗?", isConfirmed =>
+ {
+ if (isConfirmed)
+ {
+ DeleteMenu(menuInfo);
+ }
+ return true;
+ }, "MainWindowAskGrowl");
+ } else
+ {
+ DeleteMenu(menuInfo);
+ }
+ }
+
+ private void DeleteMenu(MenuInfo menuInfo)
+ {
if (appData.MenuList.Count == 1)
{
//如果删除以后没有菜单的话 先创建一个
@@ -628,5 +724,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
}
}
+
+
}
}
diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml
index 480bd9f..724e696 100644
--- a/Control/UserControls/PannelCard/RightCardControl.xaml
+++ b/Control/UserControls/PannelCard/RightCardControl.xaml
@@ -8,11 +8,12 @@
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:cst="clr-namespace:GeekDesk.Constant"
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
+ xmlns:component="clr-namespace:GeekDesk.CustomComponent.VirtualizingWrapPanel"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
xmlns:ot="clr-namespace:GeekDesk.Control.Other"
- xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppData}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
+ AllowDrop="True"
>
@@ -28,6 +29,11 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml.cs b/Control/UserControls/PannelCard/RightCardControl.xaml.cs
index dd5322b..9aa39e2 100644
--- a/Control/UserControls/PannelCard/RightCardControl.xaml.cs
+++ b/Control/UserControls/PannelCard/RightCardControl.xaml.cs
@@ -2,8 +2,10 @@
using GeekDesk.Constant;
using GeekDesk.Control.Other;
using GeekDesk.Control.Windows;
+using GeekDesk.Plugins.EveryThing;
using GeekDesk.Util;
using GeekDesk.ViewModel;
+using GeekDesk.ViewModel.Temp;
using HandyControl.Controls;
using System;
using System.Collections.ObjectModel;
@@ -124,16 +126,18 @@ namespace GeekDesk.Control.UserControls.PannelCard
///
private void IconClick(object sender, MouseButtonEventArgs e)
{
+ if (!RunTimeStatus.SEARCH_BOX_HIDED_300) return;
+
if (appData.AppConfig.DoubleOpen && e.ClickCount >= 2)
{
IconInfo icon = (IconInfo)((Panel)sender).Tag;
if (icon.AdminStartUp)
{
- StartIconApp(icon, IconStartType.ADMIN_STARTUP);
+ ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
else
{
- StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
+ ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
}
}
else if (!appData.AppConfig.DoubleOpen && e.ClickCount == 1)
@@ -141,11 +145,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
IconInfo icon = (IconInfo)((Panel)sender).Tag;
if (icon.AdminStartUp)
{
- StartIconApp(icon, IconStartType.ADMIN_STARTUP);
+ ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
else
{
- StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
+ ProcessUtil.StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
}
}
@@ -159,7 +163,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void IconAdminStart(object sender, RoutedEventArgs e)
{
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
- StartIconApp(icon, IconStartType.ADMIN_STARTUP);
+ ProcessUtil.StartIconApp(icon, IconStartType.ADMIN_STARTUP);
}
///
@@ -170,227 +174,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
private void ShowInExplore(object sender, RoutedEventArgs e)
{
IconInfo icon = (IconInfo)((MenuItem)sender).Tag;
- StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
- }
-
- private void StartIconApp(IconInfo icon, IconStartType type, bool useRelativePath = false)
- {
- try
- {
- using (Process p = new Process())
- {
- string startArg = icon.StartArg;
-
- if (startArg != null && Constants.SYSTEM_ICONS.ContainsKey(startArg))
- {
- StartSystemApp(startArg, type);
- }
- else
- {
- string path;
- if (useRelativePath)
- {
- string fullPath = Path.Combine(Constants.APP_DIR, icon.RelativePath);
- path = Path.GetFullPath(fullPath);
- }
- else
- {
- path = icon.Path;
- }
- p.StartInfo.FileName = path;
- if (!StringUtil.IsEmpty(startArg))
- {
- p.StartInfo.Arguments = startArg;
- }
- if (icon.IconType == IconType.OTHER)
- {
- if (!File.Exists(path) && !Directory.Exists(path))
- {
- //如果没有使用相对路径 那么使用相对路径启动一次
- if (!useRelativePath)
- {
- StartIconApp(icon, type, true);
- return;
- }
- else
- {
- HandyControl.Controls.Growl.WarningGlobal("程序启动失败(文件路径不存在或已删除)!");
- return;
- }
- }
- p.StartInfo.WorkingDirectory = path.Substring(0, path.LastIndexOf("\\"));
- switch (type)
- {
- case IconStartType.ADMIN_STARTUP:
- //p.StartInfo.Arguments = "1";//启动参数
- p.StartInfo.Verb = "runas";
- //p.StartInfo.CreateNoWindow = false; //设置显示窗口
- p.StartInfo.UseShellExecute = true;//不使用操作系统外壳程序启动进程
- //p.StartInfo.ErrorDialog = false;
- if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
- {
- //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
- if (appData.AppConfig.MarginHide)
- {
- if (!MarginHide.IsMargin())
- {
- MainWindow.HideApp();
- }
- }
- else
- {
- MainWindow.HideApp();
- }
-
- }
- break;// c#好像不能case穿透
- case IconStartType.DEFAULT_STARTUP:
- if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
- {
- //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
- if (appData.AppConfig.MarginHide)
- {
- if (!MarginHide.IsMargin())
- {
- MainWindow.HideApp();
- }
- }
- else
- {
- MainWindow.HideApp();
- }
- }
- break;
- case IconStartType.SHOW_IN_EXPLORE:
- p.StartInfo.FileName = "Explorer.exe";
- p.StartInfo.Arguments = "/e,/select," + icon.Path;
- break;
- }
- }
- else
- {
- if (appData.AppConfig.AppHideType == AppHideType.START_EXE && !RunTimeStatus.LOCK_APP_PANEL)
- {
- //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
- if (appData.AppConfig.MarginHide)
- {
- if (!MarginHide.IS_HIDE)
- {
- MainWindow.HideApp();
- }
- }
- else
- {
- MainWindow.HideApp();
- }
- }
- }
- p.Start();
- if (useRelativePath)
- {
- //如果使用相对路径启动成功 那么重新设置程序绝对路径
- icon.Path = path;
- }
- }
- }
- icon.Count++;
-
- //隐藏搜索框
- if (RunTimeStatus.SEARCH_BOX_SHOW)
- {
- MainWindow.mainWindow.HidedSearchBox();
- }
- }
- catch (Exception e)
- {
- if (!useRelativePath)
- {
- StartIconApp(icon, type, true);
- }
- else
- {
- HandyControl.Controls.Growl.WarningGlobal("程序启动失败(可能为不支持的启动方式)!");
- LogUtil.WriteErrorLog(e, "程序启动失败:path=" + icon.Path + ",type=" + type);
- }
- }
- }
-
-
-
- private void StartSystemApp(string startArg, IconStartType type)
- {
- if (type == IconStartType.SHOW_IN_EXPLORE)
- {
- Growl.WarningGlobal("系统项目不支持打开文件位置操作!");
- return;
- }
- switch (startArg)
- {
- case "Calculator":
- Process.Start("calc.exe");
- break;
- case "Computer":
- Process.Start("explorer.exe");
- break;
- case "GroupPolicy":
- Process.Start("gpedit.msc");
- break;
- case "Notepad":
- Process.Start("notepad");
- break;
- case "Network":
- Process.Start("ncpa.cpl");
- break;
- case "RecycleBin":
- Process.Start("shell:RecycleBinFolder");
- break;
- case "Registry":
- Process.Start("regedit.exe");
- break;
- case "Mstsc":
- if (type == IconStartType.ADMIN_STARTUP)
- {
- Process.Start("mstsc", "-admin");
- }
- else
- {
- Process.Start("mstsc");
- }
- break;
- case "Control":
- Process.Start("Control");
- break;
- case "CMD":
- if (type == IconStartType.ADMIN_STARTUP)
- {
- using (Process process = new Process())
- {
- process.StartInfo.FileName = "cmd.exe";
- process.StartInfo.Verb = "runas";
- process.Start();
- }
- }
- else
- {
- Process.Start("cmd");
- }
- break;
- case "Services":
- Process.Start("services.msc");
- break;
- }
- //如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
- if (appData.AppConfig.MarginHide)
- {
- if (!MarginHide.IS_HIDE)
- {
- MainWindow.HideApp();
- }
- }
- else
- {
- MainWindow.HideApp();
- }
+ ProcessUtil.StartIconApp(icon, IconStartType.SHOW_IN_EXPLORE);
}
///
@@ -776,56 +560,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
}
}
- public void SearchListBoxIndexAdd()
- {
- //控制移动后 鼠标即使在图标上也不显示popup
- RunTimeStatus.MOUSE_MOVE_COUNT = 0;
- MyPoptip.IsOpen = false;
-
- if (SearchListBox.Items.Count > 0)
- {
- if (SearchListBox.SelectedIndex < SearchListBox.Items.Count - 1)
- {
- SearchListBox.SelectedIndex += 1;
- }
- }
- }
-
- public void SearchListBoxIndexSub()
- {
- //控制移动后 鼠标即使在图标上也不显示popup
- RunTimeStatus.MOUSE_MOVE_COUNT = 0;
- MyPoptip.IsOpen = false;
-
- if (SearchListBox.Items.Count > 0)
- {
- if (SearchListBox.SelectedIndex > 0)
- {
- SearchListBox.SelectedIndex -= 1;
- }
- }
- }
-
- public void StartupSelectionItem()
- {
- if (SearchListBox.SelectedItem != null)
- {
- IconInfo icon = SearchListBox.SelectedItem as IconInfo;
- if (icon.AdminStartUp)
- {
- StartIconApp(icon, IconStartType.ADMIN_STARTUP);
- }
- else
- {
- StartIconApp(icon, IconStartType.DEFAULT_STARTUP);
- }
- }
- }
-
- private void SearchListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- SearchListBox.ScrollIntoView(SearchListBox.SelectedItem);
- }
+
private void PDDialog_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
{
@@ -850,7 +585,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
///
/// 菜单结果icon 列表鼠标滚轮预处理时间
/// 主要使用自定义popup解决卡顿问题解决卡顿问题
- /// 以及滚动条收尾切换菜单
+ /// 以及滚动条首尾切换菜单
///
///
///
@@ -935,105 +670,6 @@ namespace GeekDesk.Control.UserControls.PannelCard
}
- ///
- /// 搜索结果icon 列表鼠标滚轮预处理时间
- /// 主要使用自定义popup解决卡顿问题解决卡顿问题
- ///
- ///
- ///
- private void VerticalIconList_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
- {
- //控制在滚动时不显示popup 否则会在低GPU性能机器上造成卡顿
- MyPoptip.IsOpen = false;
- if (RunTimeStatus.ICONLIST_MOUSE_WHEEL)
- {
- RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 500;
- }
- else
- {
- RunTimeStatus.ICONLIST_MOUSE_WHEEL = true;
-
- new Thread(() =>
- {
- while (RunTimeStatus.MOUSE_WHEEL_WAIT_MS > 0)
- {
- Thread.Sleep(1);
- RunTimeStatus.MOUSE_WHEEL_WAIT_MS -= 1;
- }
- if (RunTimeStatus.MOUSE_ENTER_ICON)
- {
- this.Dispatcher.BeginInvoke(new Action(() =>
- {
- MyPoptip.IsOpen = true;
- }));
- }
- RunTimeStatus.MOUSE_WHEEL_WAIT_MS = 100;
- RunTimeStatus.ICONLIST_MOUSE_WHEEL = false;
- }).Start();
- }
- }
-
- ///
- /// 查询结果 ICON 鼠标进入事件
- ///
- ///
- ///
- private void SearchIcon_MouseEnter(object sender, MouseEventArgs e)
- {
-
- //显示popup
- RunTimeStatus.MOUSE_ENTER_ICON = true;
- if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL)
- {
- new Thread(() =>
- {
- this.Dispatcher.BeginInvoke(new Action(() =>
- {
- IconInfo info = (sender as Panel).Tag as IconInfo;
- MyPoptipContent.Text = info.Content;
- MyPoptip.VerticalOffset = 30;
- Thread.Sleep(100);
- if (!RunTimeStatus.ICONLIST_MOUSE_WHEEL && RunTimeStatus.MOUSE_MOVE_COUNT > 1)
- {
- MyPoptip.IsOpen = true;
- }
- }));
- }).Start();
- }
- }
-
- ///
- /// 查询结果ICON鼠标离开事件
- ///
- ///
- ///
- private void SearchIcon_MouseLeave(object sender, MouseEventArgs e)
- {
- RunTimeStatus.MOUSE_ENTER_ICON = false;
- MyPoptip.IsOpen = false;
- }
-
- ///
- /// 查询结果ICON鼠标移动事件
- ///
- ///
- ///
- private void SearchIcon_MouseMove(object sender, MouseEventArgs e)
- {
- //控制首次刷新搜索结果后, 鼠标首次移动后显示popup
- RunTimeStatus.MOUSE_MOVE_COUNT++;
-
- //防止移动后不刷新popup content
- IconInfo info = (sender as Panel).Tag as IconInfo;
- MyPoptipContent.Text = info.Content;
- MyPoptip.VerticalOffset = 30;
-
- if (RunTimeStatus.MOUSE_MOVE_COUNT > 1 && !RunTimeStatus.ICONLIST_MOUSE_WHEEL)
- {
- MyPoptip.IsOpen = true;
- }
- }
-
///
/// menu结果ICON鼠标移动事件
///
@@ -1046,5 +682,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
MyPoptipContent.Text = info.Content;
MyPoptip.VerticalOffset = 30;
}
+
+
}
}
diff --git a/Control/UserControls/ToDo/TodoControl.xaml b/Control/UserControls/ToDo/TodoControl.xaml
index 97fbd84..b6ecf16 100644
--- a/Control/UserControls/ToDo/TodoControl.xaml
+++ b/Control/UserControls/ToDo/TodoControl.xaml
@@ -82,10 +82,36 @@
-
+
diff --git a/Control/Windows/ConfigWindow.xaml b/Control/Windows/ConfigWindow.xaml
index 02e7063..788f2d5 100644
--- a/Control/Windows/ConfigWindow.xaml
+++ b/Control/Windows/ConfigWindow.xaml
@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
- xmlns:local="clr-namespace:GeekDesk"
+ xmlns:local="clr-namespace:GeekDesk" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppConfig}"
Title="Setting"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
diff --git a/Control/Windows/ConfigWindow.xaml.cs b/Control/Windows/ConfigWindow.xaml.cs
index 636d6c9..9d8c56c 100644
--- a/Control/Windows/ConfigWindow.xaml.cs
+++ b/Control/Windows/ConfigWindow.xaml.cs
@@ -1,5 +1,6 @@
using GeekDesk.Control.UserControls.Config;
using GeekDesk.Interface;
+using GeekDesk.Util;
using GeekDesk.ViewModel;
using HandyControl.Controls;
using System.Collections.Generic;
@@ -34,7 +35,7 @@ namespace GeekDesk.Control.Windows
//BG.Source = ImageUtil.Base64ToBitmapImage(Constants.DEFAULT_BAC_IMAGE_BASE64);
this.DataContext = appConfig;
RightCard.Content = about;
- this.Topmost = true;
+ WindowUtil.SetOwner(this, mainWindow);
this.mainWindow = mainWindow;
UFG.Visibility = Visibility.Collapsed;
UFG.Visibility = Visibility.Visible;
diff --git a/Control/Windows/GlobalColorPickerWindow.xaml b/Control/Windows/GlobalColorPickerWindow.xaml
index 7d5a69d..d7d4249 100644
--- a/Control/Windows/GlobalColorPickerWindow.xaml
+++ b/Control/Windows/GlobalColorPickerWindow.xaml
@@ -5,7 +5,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GeekDesk.Control.Windows"
xmlns:hc="https://handyorg.github.io/handycontrol"
+ xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
WindowStyle="None"
+ ResizeMode="NoResize"
AllowsTransparency="True"
Background="Transparent"
KeyDown="OnKeyDown"
@@ -14,15 +16,49 @@
Background="White"
Height="385"
Width="228">
-
-
-
+
+
+
+
+
-
-
-
+
+
-
+
+
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 @@
-->
-
+
-
-
-
+
+
+
diff --git a/Control/Windows/PixelColorPickerWindow.xaml b/Control/Windows/PixelColorPickerWindow.xaml
index ca1f995..f9bb3e2 100644
--- a/Control/Windows/PixelColorPickerWindow.xaml
+++ b/Control/Windows/PixelColorPickerWindow.xaml
@@ -6,6 +6,7 @@
WindowStyle="None"
AllowsTransparency="True"
Background="Black"
+ ResizeMode="NoResize"
PreviewMouseMove="Window_PreviewMouseMove"
MouseLeftButtonDown="Window_MouseLeftButtonDown"
MouseRightButtonDown="Window_MouseRightButtonDown"
diff --git a/Control/Windows/ToDoInfoWindow.xaml b/Control/Windows/ToDoInfoWindow.xaml
index e288b38..34bb8c0 100644
--- a/Control/Windows/ToDoInfoWindow.xaml
+++ b/Control/Windows/ToDoInfoWindow.xaml
@@ -12,6 +12,7 @@
Width="510"
WindowStyle="None"
Title=""
+ ResizeMode="NoResize"
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False"
Focusable="True"
@@ -44,12 +45,13 @@
-
+
-
-
@@ -73,7 +75,11 @@
-
+
+
+
+
+
@@ -81,7 +87,7 @@
-
+
@@ -95,7 +101,7 @@
-
diff --git a/Control/Windows/ToDoWindow.xaml b/Control/Windows/ToDoWindow.xaml
index 4e65bcc..5318271 100644
--- a/Control/Windows/ToDoWindow.xaml
+++ b/Control/Windows/ToDoWindow.xaml
@@ -10,6 +10,7 @@
Height="550"
Width="1000"
Title="Task"
+ ResizeMode="NoResize"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False"
@@ -89,7 +90,7 @@
diff --git a/Control/Windows/ToDoWindow.xaml.cs b/Control/Windows/ToDoWindow.xaml.cs
index 3744b13..02580b8 100644
--- a/Control/Windows/ToDoWindow.xaml.cs
+++ b/Control/Windows/ToDoWindow.xaml.cs
@@ -2,6 +2,11 @@
using GeekDesk.Interface;
using GeekDesk.ViewModel;
using HandyControl.Controls;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Reactive.Linq;
using System.Windows;
using System.Windows.Input;
@@ -64,6 +69,14 @@ namespace GeekDesk.Control.Windows
{
case "History":
UFG.Visibility = Visibility.Collapsed;
+ //排序历史待办 倒序
+
+ List list = appData.HiToDoList.OrderByDescending(v=>v.DoneTime).ToList();
+ appData.HiToDoList.Clear();
+ foreach (var item in list)
+ {
+ appData.HiToDoList.Add(item);
+ }
backlog.BacklogList.ItemsSource = appData.HiToDoList;
if (backlog.BacklogList.Items.Count > 0)
{
diff --git a/Control/Windows/UpdateWindow.xaml b/Control/Windows/UpdateWindow.xaml
index 0f599ce..b8ea9e2 100644
--- a/Control/Windows/UpdateWindow.xaml
+++ b/Control/Windows/UpdateWindow.xaml
@@ -10,6 +10,7 @@
WindowStyle="None"
AllowsTransparency="True"
Title=""
+ ResizeMode="NoResize"
Background="Transparent" ShowInTaskbar="False"
Focusable="True"
KeyDown="OnKeyDown">
@@ -28,7 +29,7 @@
@@ -55,8 +56,8 @@
-
-
+
+
diff --git a/Converts/GetWidthByWWConvert.cs b/Converts/GetWidthByWWConvert.cs
index 3469296..7f2633d 100644
--- a/Converts/GetWidthByWWConvert.cs
+++ b/Converts/GetWidthByWWConvert.cs
@@ -26,7 +26,21 @@ namespace GeekDesk.Converts
return config.WindowWidth - config.MenuCardWidth;
} else if (WidthTypeEnum.RIGHT_CARD_HALF == type)
{
- return (config.WindowWidth - config.MenuCardWidth) / 2;
+ return (config.WindowWidth - config.MenuCardWidth) * 0.618;
+ } else if (WidthTypeEnum.RIGHT_CARD_HALF_TEXT == type)
+ {
+ return (config.WindowWidth - config.MenuCardWidth) * 0.618 - config.ImageWidth - 20;
+ } else if (WidthTypeEnum.RIGHT_CARD_20 == type)
+ {
+ return (config.WindowWidth - config.MenuCardWidth) - 20;
+ }
+ else if (WidthTypeEnum.RIGHT_CARD_40 == type)
+ {
+ return (config.WindowWidth - config.MenuCardWidth) - 40;
+ }
+ else if (WidthTypeEnum.RIGHT_CARD_70 == type)
+ {
+ return (config.WindowWidth - config.MenuCardWidth) - 70;
}
return config.WindowWidth;
diff --git a/Converts/Visibility2BooleanConverter.cs b/Converts/Visibility2BooleanConverter.cs
index 3d941c8..c32e508 100644
--- a/Converts/Visibility2BooleanConverter.cs
+++ b/Converts/Visibility2BooleanConverter.cs
@@ -9,14 +9,14 @@ namespace GeekDesk.Converts
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- if ((Visibility)value == Visibility.Visible)
+ if (parameter == null)
{
- return true;
- }
- else
+ return (Visibility)value == Visibility.Visible;
+ } else
{
- return false;
+ return !((Visibility)value == Visibility.Visible);
}
+
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
diff --git a/DraggAnimatedPanel/DraggAnimatedPanel.Drag.cs b/CustomComponent/DraggAnimatedPanel/DraggAnimatedPanel.Drag.cs
similarity index 100%
rename from DraggAnimatedPanel/DraggAnimatedPanel.Drag.cs
rename to CustomComponent/DraggAnimatedPanel/DraggAnimatedPanel.Drag.cs
diff --git a/DraggAnimatedPanel/DraggAnimatedPanel.cs b/CustomComponent/DraggAnimatedPanel/DraggAnimatedPanel.cs
similarity index 100%
rename from DraggAnimatedPanel/DraggAnimatedPanel.cs
rename to CustomComponent/DraggAnimatedPanel/DraggAnimatedPanel.cs
diff --git a/CustomComponent/VirtualizingWrapPanel/ItemRange.cs b/CustomComponent/VirtualizingWrapPanel/ItemRange.cs
new file mode 100644
index 0000000..b2865a8
--- /dev/null
+++ b/CustomComponent/VirtualizingWrapPanel/ItemRange.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
+{
+ public struct ItemRange
+ {
+ public int StartIndex { get; }
+ public int EndIndex { get; }
+
+ public ItemRange(int startIndex, int endIndex) : this()
+ {
+ StartIndex = startIndex;
+ EndIndex = endIndex;
+ }
+
+ public bool Contains(int itemIndex)
+ {
+ return itemIndex >= StartIndex && itemIndex <= EndIndex;
+ }
+ }
+}
diff --git a/CustomComponent/VirtualizingWrapPanel/ScrollDirection.cs b/CustomComponent/VirtualizingWrapPanel/ScrollDirection.cs
new file mode 100644
index 0000000..6cfd930
--- /dev/null
+++ b/CustomComponent/VirtualizingWrapPanel/ScrollDirection.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
+{
+ public enum ScrollDirection
+ {
+ Vertical,
+ Horizontal
+ }
+}
diff --git a/CustomComponent/VirtualizingWrapPanel/SpacingMode.cs b/CustomComponent/VirtualizingWrapPanel/SpacingMode.cs
new file mode 100644
index 0000000..5c6564b
--- /dev/null
+++ b/CustomComponent/VirtualizingWrapPanel/SpacingMode.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
+{
+ public enum SpacingMode
+ {
+ ///
+ /// Spacing is disabled and all items will be arranged as closely as possible.
+ ///
+ None,
+ ///
+ /// The remaining space is evenly distributed between the items on a layout row, as well as the start and end of each row.
+ ///
+ Uniform,
+ ///
+ /// The remaining space is evenly distributed between the items on a layout row, excluding the start and end of each row.
+ ///
+ BetweenItemsOnly,
+ ///
+ /// The remaining space is evenly distributed between start and end of each row.
+ ///
+ StartAndEndOnly
+ }
+}
diff --git a/CustomComponent/VirtualizingWrapPanel/VirtualizingPanelBase.cs b/CustomComponent/VirtualizingWrapPanel/VirtualizingPanelBase.cs
new file mode 100644
index 0000000..175134a
--- /dev/null
+++ b/CustomComponent/VirtualizingWrapPanel/VirtualizingPanelBase.cs
@@ -0,0 +1,492 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls.Primitives;
+using System.Windows.Controls;
+using System.Windows.Media;
+using System.Windows;
+
+namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
+{
+ public abstract class VirtualizingPanelBase : VirtualizingPanel, IScrollInfo
+ {
+ public static readonly DependencyProperty ScrollLineDeltaProperty = DependencyProperty.Register(nameof(ScrollLineDelta), typeof(double), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(16.0));
+ public static readonly DependencyProperty MouseWheelDeltaProperty = DependencyProperty.Register(nameof(MouseWheelDelta), typeof(double), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(48.0));
+ public static readonly DependencyProperty ScrollLineDeltaItemProperty = DependencyProperty.Register(nameof(ScrollLineDeltaItem), typeof(int), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(1));
+ public static readonly DependencyProperty MouseWheelDeltaItemProperty = DependencyProperty.Register(nameof(MouseWheelDeltaItem), typeof(int), typeof(VirtualizingPanelBase), new FrameworkPropertyMetadata(3));
+ private ScrollViewer scrollOwner;
+
+ public ScrollViewer GetScrollOwner()
+ {
+ return scrollOwner;
+ }
+
+ public void SetScrollOwner(ScrollViewer value)
+ {
+ scrollOwner = value;
+ }
+
+ public bool CanVerticallyScroll { get; set; }
+ public bool CanHorizontallyScroll { get; set; }
+
+ protected override bool CanHierarchicallyScrollAndVirtualizeCore => true;
+
+ ///
+ /// Scroll line delta for pixel based scrolling. The default value is 16 dp.
+ ///
+ public double ScrollLineDelta { get => (double)GetValue(ScrollLineDeltaProperty); set => SetValue(ScrollLineDeltaProperty, value); }
+
+ ///
+ /// Mouse wheel delta for pixel based scrolling. The default value is 48 dp.
+ ///
+ public double MouseWheelDelta { get => (double)GetValue(MouseWheelDeltaProperty); set => SetValue(MouseWheelDeltaProperty, value); }
+
+ ///
+ /// Scroll line delta for item based scrolling. The default value is 1 item.
+ ///
+ public double ScrollLineDeltaItem { get => (int)GetValue(ScrollLineDeltaItemProperty); set => SetValue(ScrollLineDeltaItemProperty, value); }
+
+ ///
+ /// Mouse wheel delta for item based scrolling. The default value is 3 items.
+ ///
+ public int MouseWheelDeltaItem { get => (int)GetValue(MouseWheelDeltaItemProperty); set => SetValue(MouseWheelDeltaItemProperty, value); }
+
+ protected ScrollUnit ScrollUnit => GetScrollUnit(ItemsControl);
+
+ ///
+ /// The direction in which the panel scrolls when user turns the mouse wheel.
+ ///
+ protected ScrollDirection MouseWheelScrollDirection { get; set; } = ScrollDirection.Vertical;
+
+
+ protected bool IsVirtualizing => GetIsVirtualizing(ItemsControl);
+
+ protected VirtualizationMode VirtualizationMode => GetVirtualizationMode(ItemsControl);
+
+ ///
+ /// Returns true if the panel is in VirtualizationMode.Recycling, otherwise false.
+ ///
+ protected bool IsRecycling => VirtualizationMode == VirtualizationMode.Recycling;
+
+ ///
+ /// The cache length before and after the viewport.
+ ///
+ protected VirtualizationCacheLength CacheLength { get; private set; }
+
+ ///
+ /// The Unit of the cache length. Can be Pixel, Item or Page.
+ /// When the ItemsOwner is a group item it can only be pixel or item.
+ ///
+ protected VirtualizationCacheLengthUnit CacheLengthUnit { get; private set; }
+
+
+ ///
+ /// The ItemsControl (e.g. ListView).
+ ///
+ protected ItemsControl ItemsControl => ItemsControl.GetItemsOwner(this);
+
+ ///
+ /// The ItemsControl (e.g. ListView) or if the ItemsControl is grouping a GroupItem.
+ ///
+ protected DependencyObject ItemsOwner
+ {
+ get
+ {
+ if (ItemsOwner1 is null)
+ {
+ /* Use reflection to access internal method because the public
+ * GetItemsOwner method does always return the itmes control instead
+ * of the real items owner for example the group item when grouping */
+ MethodInfo getItemsOwnerInternalMethod = typeof(ItemsControl).GetMethod(
+ "GetItemsOwnerInternal",
+ BindingFlags.Static | BindingFlags.NonPublic,
+ null,
+ new Type[] { typeof(DependencyObject) },
+ null
+ );
+ ItemsOwner1 = (DependencyObject)getItemsOwnerInternalMethod.Invoke(null, new object[] { this });
+ }
+ return ItemsOwner1;
+ }
+ }
+ private DependencyObject _itemsOwner;
+
+ protected ReadOnlyCollection