diff --git a/Constant/RunTimeStatus.cs b/Constant/RunTimeStatus.cs
new file mode 100644
index 0000000..ae58d12
--- /dev/null
+++ b/Constant/RunTimeStatus.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace GeekDesk.Constant
+{
+ internal class RunTimeStatus
+ {
+
+ ///
+ /// 查询框是否在工作
+ ///
+ public static bool SEARCH_BOX_SHOW = false;
+ }
+}
diff --git a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
index 3150af2..7ed41bd 100644
--- a/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
+++ b/Control/UserControls/PannelCard/LeftCardControl.xaml.cs
@@ -1,4 +1,5 @@
using DraggAnimatedPanelExample;
+using GeekDesk.Constant;
using GeekDesk.Control.Windows;
using GeekDesk.MyThread;
using GeekDesk.Util;
@@ -111,13 +112,6 @@ namespace GeekDesk.Control.UserControls.PannelCard
}
}
- //////菜单点击事件
- //private void MenuClick(object sender, MouseButtonEventArgs e)
- //{
- // //设置对应菜单的图标列表
- // MenuInfo mi = (MenuInfo)(((StackPanel)sender).Tag);
- // appData.AppConfig.SelectedMenuIcons = mi.IconList;
- //}
///
/// 当修改菜单元素可见时 设置原菜单为不可见 并且不可选中
diff --git a/Control/UserControls/PannelCard/RightCardControl.xaml b/Control/UserControls/PannelCard/RightCardControl.xaml
index 7912bd1..bbf1ca9 100644
--- a/Control/UserControls/PannelCard/RightCardControl.xaml
+++ b/Control/UserControls/PannelCard/RightCardControl.xaml
@@ -137,14 +137,17 @@
-
+ Margin="5,0,5,5" Grid.ColumnSpan="2"
+ MouseLeftButtonDown="VerticalCard_MouseLeftButtonDown"
+ >
-
+
@@ -180,11 +183,19 @@
+
+
+
+
+
+
+ /// 搜索Card点击事件
+ ///
+ ///
+ ///
+ private void VerticalCard_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ //隐藏搜索框
+ if (RunTimeStatus.SEARCH_BOX_SHOW)
+ {
+ MainWindow.mainWindow.HidedSearchBox();
+ }
+ }
}
}
diff --git a/Converts/SearchResWidth.cs b/Converts/SearchResWidth.cs
index 6e0b400..55d8af5 100644
--- a/Converts/SearchResWidth.cs
+++ b/Converts/SearchResWidth.cs
@@ -13,8 +13,16 @@ namespace GeekDesk.Converts
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- double menuLeftWidth = double.Parse(value.ToString());
- return MainWindow.mainWindow.Width - menuLeftWidth;
+ string param = parameter as string;
+ if ("1".Equals(param))
+ {
+ double menuLeftWidth = double.Parse(value.ToString());
+ return MainWindow.mainWindow.Width - menuLeftWidth;
+ } else
+ {
+ double menuLeftWidth = double.Parse(value.ToString());
+ return (MainWindow.mainWindow.Width - menuLeftWidth) / 2;
+ }
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
diff --git a/GeekDesk.csproj b/GeekDesk.csproj
index eed90d7..f959d11 100644
--- a/GeekDesk.csproj
+++ b/GeekDesk.csproj
@@ -130,6 +130,7 @@
+
diff --git a/MainWindow.xaml b/MainWindow.xaml
index fc73cf5..76fe69f 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -137,7 +137,6 @@
private void SearchItem(object sender, CanExecuteRoutedEventArgs e)
{
+ RunTimeStatus.SEARCH_BOX_SHOW = true;
RightCard.VisibilitySearchCard(Visibility.Visible);
SearchBox.Visibility = Visibility.Visible;
SearchBox.Focus();
@@ -92,13 +93,10 @@ namespace GeekDesk
SearchIconList.IconList.Clear();
}
}
- ///
- /// 隐藏搜索框
- ///
- ///
- ///
- private void SearchBox_LostFocus(object sender, RoutedEventArgs e)
+
+ public void HidedSearchBox()
{
+ RunTimeStatus.SEARCH_BOX_SHOW = false;
SearchIconList.IconList.Clear();
RightCard.VisibilitySearchCard(Visibility.Collapsed);
SearchBox.Visibility = Visibility.Collapsed;
diff --git a/MainWindow.xaml.rej b/MainWindow.xaml.rej
new file mode 100644
index 0000000..1b27959
--- /dev/null
+++ b/MainWindow.xaml.rej
@@ -0,0 +1,9 @@
+diff a/MainWindow.xaml b/MainWindow.xaml (rejected hunks)
+@@ -20,6 +20,7 @@
+ SizeChanged="Window_SizeChanged"
+ KeyDown="OnKeyDown"
+ Focusable="True"
++ GotFocus="MainWindow_GotFocus"
+ MouseDown="MainWindow_MouseDown"
+ >
+