liufei 4 lat temu
rodzic
commit
4a8ddc4ce9

Plik diff jest za duży
+ 0 - 0
Constant/Constants.cs


+ 2 - 2
Control/UserControls/Config/MotionControl.xaml

@@ -66,7 +66,7 @@
                         KeyUp="HotKeyUp"
                         KeyUp="HotKeyUp"
                         Margin="12.967,-7.38,-12.967,0"/>
                         Margin="12.967,-7.38,-12.967,0"/>
         </hc:UniformSpacingPanel>
         </hc:UniformSpacingPanel>
-        <hc:UniformSpacingPanel Spacing="10" Margin="30,229,0,-216.337" Grid.ColumnSpan="4">
+        <!--<hc:UniformSpacingPanel Spacing="10" Margin="30,229,0,-216.337" Grid.ColumnSpan="4">
             <TextBlock Text="新建待办:"  Width="55"/>
             <TextBlock Text="新建待办:"  Width="55"/>
             <hc:TextBox HorizontalAlignment="Left" 
             <hc:TextBox HorizontalAlignment="Left" 
                         Tag="ToDo"
                         Tag="ToDo"
@@ -78,7 +78,7 @@
                         KeyDown="HotKeyDown"
                         KeyDown="HotKeyDown"
                         KeyUp="HotKeyUp"
                         KeyUp="HotKeyUp"
                         Margin="12.967,-7.38,-12.967,0"/>
                         Margin="12.967,-7.38,-12.967,0"/>
-        </hc:UniformSpacingPanel>
+        </hc:UniformSpacingPanel>-->
         <StackPanel hc:Growl.GrowlParent="True" hc:Growl.Token="HotKeyGrowl" VerticalAlignment="Top"/>
         <StackPanel hc:Growl.GrowlParent="True" hc:Growl.Token="HotKeyGrowl" VerticalAlignment="Top"/>
     </hc:SimplePanel>
     </hc:SimplePanel>
    
    

+ 7 - 2
Control/UserControls/PannelCard/LeftCardControl.xaml

@@ -20,7 +20,8 @@
                     <SolidColorBrush Opacity="0"/>
                     <SolidColorBrush Opacity="0"/>
                 </Setter.Value>
                 </Setter.Value>
             </Setter>
             </Setter>
-
+            <EventSetter Event="MouseLeftButtonDown" Handler="MenuClick"/>
+            <EventSetter Event="MouseRightButtonDown" Handler="MenuClick"/>
             <Style.Triggers>
             <Style.Triggers>
                 <MultiTrigger>
                 <MultiTrigger>
                     <MultiTrigger.Conditions>
                     <MultiTrigger.Conditions>
@@ -74,12 +75,13 @@
                 </ContextMenu>
                 </ContextMenu>
             </hc:Card.ContextMenu>
             </hc:Card.ContextMenu>
             <WrapPanel Orientation="Horizontal">
             <WrapPanel Orientation="Horizontal">
-                <ListBox x:Name="menus"
+                <ListBox x:Name="MenuListBox"
                          ItemsSource="{Binding MenuList}"
                          ItemsSource="{Binding MenuList}"
                          Tag="{Binding AppConfig.MenuCardWidth}"
                          Tag="{Binding AppConfig.MenuCardWidth}"
                          BorderThickness="0" Foreground="{x:Null}"
                          BorderThickness="0" Foreground="{x:Null}"
                          SelectedIndex="{Binding AppConfig.SelectedMenuIndex}"
                          SelectedIndex="{Binding AppConfig.SelectedMenuIndex}"
                          VirtualizingPanel.VirtualizationMode="Recycling"
                          VirtualizingPanel.VirtualizationMode="Recycling"
+                         SelectionChanged="menus_SelectionChanged"
                          >
                          >
                     <ListBox.Resources>
                     <ListBox.Resources>
                         <ContextMenu x:Key="menuDialog" Width="200">
                         <ContextMenu x:Key="menuDialog" Width="200">
@@ -108,6 +110,9 @@
                     <ListBox.ItemTemplate>
                     <ListBox.ItemTemplate>
                         <DataTemplate>
                         <DataTemplate>
                         <StackPanel MouseLeftButtonDown="MenuClick" MouseRightButtonDown="MenuClick" Tag="{Binding}">
                         <StackPanel MouseLeftButtonDown="MenuClick" MouseRightButtonDown="MenuClick" Tag="{Binding}">
+                            <StackPanel.Background>
+                                <SolidColorBrush Color="AliceBlue" Opacity="0.01"/>
+                            </StackPanel.Background>
                                 <hc:TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
                                 <hc:TextBox Text="{Binding Path=MenuName, Mode=TwoWay}"
                                      HorizontalAlignment="Left"
                                      HorizontalAlignment="Left"
                                      Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}"
                                      Width="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type ListBox},AncestorLevel=1},Path=Tag, Mode=TwoWay, Converter={StaticResource MenuWidthConvert}}"

+ 39 - 15
Control/UserControls/PannelCard/LeftCardControl.xaml.cs

@@ -25,7 +25,13 @@ namespace GeekDesk.Control.UserControls.PannelCard
         public LeftCardControl()
         public LeftCardControl()
         {
         {
             InitializeComponent();
             InitializeComponent();
-            appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
+            if (appData.AppConfig.SelectedMenuIndex >= appData.MenuList.Count || appData.AppConfig.SelectedMenuIndex == -1)
+            {
+                appData.AppConfig.SelectedMenuIcons = appData.MenuList[0].IconList;
+            } else
+            {
+                appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.AppConfig.SelectedMenuIndex].IconList;
+            }
 
 
         }
         }
 
 
@@ -46,7 +52,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
                             var dragged = menuList[fromS];
                             var dragged = menuList[fromS];
                             menuList.Remove(dragged);
                             menuList.Remove(dragged);
                             menuList.Insert(to, dragged);
                             menuList.Insert(to, dragged);
-                            menus.SelectedIndex = to;
+                            MenuListBox.SelectedIndex = to;
                             MainWindow.appData.MenuList = menuList;
                             MainWindow.appData.MenuList = menuList;
                         }
                         }
                     );
                     );
@@ -73,14 +79,14 @@ namespace GeekDesk.Control.UserControls.PannelCard
             TextBlock tb = sender as TextBlock;
             TextBlock tb = sender as TextBlock;
             if (tb.Visibility == Visibility.Collapsed)
             if (tb.Visibility == Visibility.Collapsed)
             {
             {
-                if (menus.SelectedIndex != -1)
+                if (MenuListBox.SelectedIndex != -1)
                 {
                 {
-                    menuSelectIndexTemp = menus.SelectedIndex;
-                    menus.SelectedIndex = -1;
+                    menuSelectIndexTemp = MenuListBox.SelectedIndex;
+                    MenuListBox.SelectedIndex = -1;
                 }
                 }
                 else
                 else
                 {
                 {
-                    menus.SelectedIndex = menuSelectIndexTemp;
+                    MenuListBox.SelectedIndex = menuSelectIndexTemp;
                 }
                 }
             }
             }
         }
         }
@@ -94,9 +100,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
         {
         {
             MenuInfo info = new MenuInfo() { MenuEdit = Visibility.Collapsed, MenuId = System.Guid.NewGuid().ToString(), MenuName = "NewMenu" };
             MenuInfo info = new MenuInfo() { MenuEdit = Visibility.Collapsed, MenuId = System.Guid.NewGuid().ToString(), MenuName = "NewMenu" };
             appData.MenuList.Add(info);
             appData.MenuList.Add(info);
-            menus.Items.Refresh();
-            menus.SelectedIndex = appData.MenuList.Count - 1;
-            appData.AppConfig.SelectedMenuIndex = menus.SelectedIndex;
+            MenuListBox.Items.Refresh();
+            MenuListBox.SelectedIndex = appData.MenuList.Count - 1;
+            appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
             appData.AppConfig.SelectedMenuIcons = info.IconList;
             appData.AppConfig.SelectedMenuIcons = info.IconList;
         }
         }
 
 
@@ -124,14 +130,20 @@ namespace GeekDesk.Control.UserControls.PannelCard
                 //如果删除以后没有菜单的话 先创建一个
                 //如果删除以后没有菜单的话 先创建一个
                 CreateMenu(null, null);
                 CreateMenu(null, null);
             }
             }
-            appData.MenuList.Remove(menuInfo);
-            if (menus.SelectedIndex == -1)
+            int index = appData.MenuList.IndexOf(menuInfo);
+            if(index == 0)
             {
             {
-                // 选中下一个菜单
-                menus.SelectedIndex = 0;
-                appData.AppConfig.SelectedMenuIndex = menus.SelectedIndex;
-                appData.AppConfig.SelectedMenuIcons = appData.MenuList[0].IconList;
+                index = 0;
+            } else
+            {
+                index = index - 1;
             }
             }
+
+            appData.MenuList.Remove(menuInfo);
+            // 选中下一个菜单
+            MenuListBox.SelectedIndex = index;
+            appData.AppConfig.SelectedMenuIndex = MenuListBox.SelectedIndex;
+            appData.AppConfig.SelectedMenuIcons = appData.MenuList[index].IconList;
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -189,5 +201,17 @@ namespace GeekDesk.Control.UserControls.PannelCard
             MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
             MenuInfo menuInfo = ((MenuItem)sender).Tag as MenuInfo;
             IconfontWindow.Show(SvgToGeometry.GetIconfonts(), menuInfo);
             IconfontWindow.Show(SvgToGeometry.GetIconfonts(), menuInfo);
         }
         }
+
+        private void menus_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            //设置对应菜单的图标列表
+            if (MenuListBox.SelectedIndex == -1)
+            {
+                appData.AppConfig.SelectedMenuIcons = appData.MenuList[appData.MenuList.Count-1].IconList;
+            } else
+            {
+                appData.AppConfig.SelectedMenuIcons = appData.MenuList[MenuListBox.SelectedIndex].IconList;
+            }
+        }
     }
     }
 }
 }

+ 1 - 1
Control/UserControls/PannelCard/RightCardControl.xaml.cs

@@ -173,7 +173,7 @@ namespace GeekDesk.Control.UserControls.PannelCard
             {
             {
                 string path = (string)obj;
                 string path = (string)obj;
 
 
-                string base64 = ImageUtil.FileImageToBase64(path, ImageFormat.Png);
+                string base64 = ImageUtil.FileImageToBase64(path, ImageFormat.Jpeg);
 
 
                 IconInfo iconInfo = new IconInfo
                 IconInfo iconInfo = new IconInfo
                 {
                 {

+ 2 - 2
Control/Windows/IconfontWindow.xaml

@@ -29,12 +29,12 @@
         <Grid MouseDown="DragMove">
         <Grid MouseDown="DragMove">
             <TextBox x:Name="CheckSettingUrl" Visibility="Collapsed" Text="{Binding IsSettingUrl}" TextChanged="CheckSettingUrl_TextChanged"/>
             <TextBox x:Name="CheckSettingUrl" Visibility="Collapsed" Text="{Binding IsSettingUrl}" TextChanged="CheckSettingUrl_TextChanged"/>
             <hc:TabControl x:Name="MyTabControl" IsAnimationEnabled="True" SelectionChanged="TabControl_SelectionChanged" ShowContextMenu="True"  IsTabFillEnabled="True" Margin="20,30,20,20" Height="350" VerticalAlignment="Top">
             <hc:TabControl x:Name="MyTabControl" IsAnimationEnabled="True" SelectionChanged="TabControl_SelectionChanged" ShowContextMenu="True"  IsTabFillEnabled="True" Margin="20,30,20,20" Height="350" VerticalAlignment="Top">
-                <hc:TabItem Tag="System"  IsSelected="True" Header="系统图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CalendarGeometry}" >
+                <hc:TabItem Tag="System"  IsSelected="True" Header="系统图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource SystemIcon}" >
                     <hc:SimplePanel Background="AliceBlue">
                     <hc:SimplePanel Background="AliceBlue">
                         <uc:IconPannel x:Name="SystemIcon"/>
                         <uc:IconPannel x:Name="SystemIcon"/>
                     </hc:SimplePanel>
                     </hc:SimplePanel>
                 </hc:TabItem>
                 </hc:TabItem>
-                <hc:TabItem Tag="Custom" Header="自定义图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CalendarGeometry}">
+                <hc:TabItem Tag="Custom" Header="自定义图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CustomIcon}">
                     <hc:SimplePanel Background="AliceBlue">
                     <hc:SimplePanel Background="AliceBlue">
                         <uc:IconPannel x:Name="CustomIcon"/>
                         <uc:IconPannel x:Name="CustomIcon"/>
                         <hc:LoadingCircle x:Name="LoadingEle"/>
                         <hc:LoadingCircle x:Name="LoadingEle"/>

+ 4 - 3
Control/Windows/ToDoInfoWindow.xaml.cs

@@ -125,10 +125,10 @@ namespace GeekDesk.Control.Windows
             if (window == null || !window.Activate())
             if (window == null || !window.Activate())
             {
             {
                 window = new ToDoInfoWindow();
                 window = new ToDoInfoWindow();
-                
+                window.Show();
             }
             }
             windowType = NEW_TODO;
             windowType = NEW_TODO;
-            window.Show();
+            window.Visibility = Visibility.Visible;
         }
         }
 
 
 
 
@@ -137,8 +137,9 @@ namespace GeekDesk.Control.Windows
             if (window == null || !window.Activate())
             if (window == null || !window.Activate())
             {
             {
                 window = new ToDoInfoWindow();
                 window = new ToDoInfoWindow();
-
+                window.Show();
             }
             }
+            window.Visibility = Visibility.Collapsed;
             windowType = NEW_TODO;
             windowType = NEW_TODO;
             return window;
             return window;
         }
         }

+ 4 - 3
MainWindow.xaml.cs

@@ -30,7 +30,8 @@ namespace GeekDesk
     {
     {
 
 
         public static AppData appData = CommonCode.GetAppDataByFile();
         public static AppData appData = CommonCode.GetAppDataByFile();
-        public static ToDoInfoWindow toDoInfoWindow = (ToDoInfoWindow)ToDoInfoWindow.GetThis();
+        //public static ToDoInfoWindow toDoInfoWindow = (ToDoInfoWindow)ToDoInfoWindow.GetThis();
+        public static ToDoInfoWindow toDoInfoWindow;
         public static int hotKeyId = -1;
         public static int hotKeyId = -1;
         public static int toDoHotKeyId = -1;
         public static int toDoHotKeyId = -1;
         public static MainWindow mainWindow;
         public static MainWindow mainWindow;
@@ -69,7 +70,7 @@ namespace GeekDesk
                 ShowApp();
                 ShowApp();
             }
             }
             RegisterHotKey(true);
             RegisterHotKey(true);
-            RegisterCreateToDoHotKey(true);
+            //RegisterCreateToDoHotKey(true);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -126,7 +127,7 @@ namespace GeekDesk
                 if (appData.AppConfig.ToDoHotkeyModifiers!=0)
                 if (appData.AppConfig.ToDoHotkeyModifiers!=0)
                 {
                 {
                     //加载完毕注册热键
                     //加载完毕注册热键
-                    toDoHotKeyId = Hotkey.Regist(new WindowInteropHelper(toDoInfoWindow).Handle, appData.AppConfig.ToDoHotkeyModifiers, appData.AppConfig.ToDoHotkey, () =>
+                    toDoHotKeyId = Hotkey.Regist(new WindowInteropHelper(MainWindow.mainWindow).Handle, appData.AppConfig.ToDoHotkeyModifiers, appData.AppConfig.ToDoHotkey, () =>
                     {
                     {
                         if (MotionControl.hotkeyFinished)
                         if (MotionControl.hotkeyFinished)
                         {
                         {

Plik diff jest za duży
+ 6 - 0
Resource/Dictionary/Geometry.xaml


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików