7 Commits

Author SHA1 Message Date
liufei
8ee27e247b 修改编码 2021-12-20 16:51:59 +08:00
liufei
cf8f983f1a 2.3.21 2021-12-20 16:42:58 +08:00
liufei
37e8631f73 修复一个测试遗留bug 2021-12-20 16:39:51 +08:00
liufei
0f6119c0ba 去除选中控件后的虚线 2021-12-20 10:59:37 +08:00
liufei
caf75e2427 不开启中键启动时不再占用线程 2021-12-20 09:56:43 +08:00
liufei
c13593bdf4 Esc退出窗口 2021-12-20 09:42:13 +08:00
liufei
e6a95c4668 增加Esc退出窗口 2021-12-20 09:39:27 +08:00
26 changed files with 182 additions and 103 deletions

View File

@@ -28,7 +28,7 @@
</assemblyBinding>
</runtime>
<appSettings>
<add key="Version" value="2.3.20" />
<add key="Version" value="2.3.21" />
<add key="GitHubUrl" value="https://github.com/Demo-Liu/GeekDesk" />
<add key="GiteeUrl" value="https://gitee.com/demo_liu/GeekDesk/tree/master" />
<add key="GitHubUpdateUrl" value="https://demo-liu.github.io/GeekDesk/Update.json" />

View File

@@ -41,7 +41,7 @@
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="鼠标中间呼出" Checked="MouseMiddle_Changed" IsChecked="{Binding MouseMiddleShow}">
<CheckBox Content="鼠标中间呼出" Checked="MouseMiddle_Changed" Unchecked="MouseMiddle_Changed" IsChecked="{Binding MouseMiddleShow}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>

View File

@@ -1,5 +1,6 @@
using GeekDesk.Constant;
using GeekDesk.Control.Windows;
using GeekDesk.Thread;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using HandyControl.Data;
@@ -280,12 +281,14 @@ namespace GeekDesk.Control.UserControls.Config
/// <param name="e"></param>
private void MouseMiddle_Changed(object sender, RoutedEventArgs e)
{
if (appConfig.MouseMiddleShow)
{
MouseHookThread.MiddleHook();
} else
{
MouseHookThread.Dispose();
}
}
private void HookListener_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
Console.WriteLine(e.KeyChar);
}
}
}

View File

@@ -20,6 +20,7 @@
<SolidColorBrush Opacity="0"/>
</Setter.Value>
</Setter>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<EventSetter Event="MouseLeftButtonDown" Handler="MenuClick"/>
<EventSetter Event="MouseRightButtonDown" Handler="MenuClick"/>
<Style.Triggers>

View File

@@ -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<int[]> _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;
}

View File

@@ -19,6 +19,7 @@
<Setter Property="Source" Value="{Binding BitmapImage}"/>
</Style>
<Style x:Key="MyListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">

View File

@@ -5,25 +5,16 @@ using GeekDesk.Util;
using GeekDesk.ViewModel;
using HandyControl.Controls;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
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.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace GeekDesk.Control.UserControls.PannelCard
{
@@ -190,8 +181,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
string path = (string)obj;
//string base64 = ImageUtil.FileImageToBase64(path, ImageFormat.Png);
string ext = System.IO.Path.GetExtension(path).ToLower();
string ext = "";
if (!ImageUtil.IsSystemItem(path))
{
ext = System.IO.Path.GetExtension(path).ToLower();
}
if (".lnk".Equals(ext))
{

View File

@@ -15,6 +15,8 @@
AllowsTransparency="True"
Background="#00FFFFFF" ShowInTaskbar="False"
BorderThickness="0"
Focusable="True"
KeyDown="OnKeyDown"
>
<Grid Margin="30">

View File

@@ -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
/// <summary>
/// ConfigDialog.xaml 的交互逻辑
/// </summary>
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();
}
}
}
}

View File

@@ -14,6 +14,8 @@
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False"
BorderThickness="0"
Focusable="True"
KeyDown="OnKeyDown"
>
<Window.Resources>
@@ -39,7 +41,7 @@
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"
RenderingBias="Quality" ShadowDepth="2"/>
</Grid.Effect>
<Border MouseDown="DragMove" Style="{StaticResource BorderBG}">
<Border MouseDown="DragMove" Style="{StaticResource BorderBG}" hc:Dialog.Token="IconUrlDialog">
<!--<Border.Background>
--><!--<SolidColorBrush Color="AliceBlue" Opacity="0.9"/>--><!--
<LinearGradientBrush Opacity="0.97">
@@ -47,9 +49,10 @@
<GradientStop Color="#97D282" Offset="1"/>
</LinearGradientBrush>
</Border.Background>-->
<Grid MouseDown="DragMove">
<TextBox x:Name="CheckSettingUrl" Visibility="Collapsed" Text="{Binding IsSettingUrl}" TextChanged="CheckSettingUrl_TextChanged"/>
<hc:TabControl x:Name="MyTabControl"
<hc:DialogContainer>
<Grid MouseDown="DragMove">
<TextBox x:Name="CheckSettingUrl" Visibility="Collapsed" Text="{Binding IsSettingUrl}" TextChanged="CheckSettingUrl_TextChanged"/>
<hc:TabControl x:Name="MyTabControl"
IsAnimationEnabled="True"
SelectionChanged="TabControl_SelectionChanged"
ShowContextMenu="True"
@@ -58,24 +61,25 @@
Height="350"
VerticalAlignment="Top"
Style="{StaticResource HcTabControl}">
<hc:TabItem Tag="System" IsSelected="True" Header="系统图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource SystemIcon}" Style="{StaticResource TabTitle}">
<hc:SimplePanel>
<uc:IconPannel x:Name="SystemIcon"/>
</hc:SimplePanel>
</hc:TabItem>
<hc:TabItem Tag="Custom" Header="自定义图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CustomIcon}" Style="{StaticResource TabTitle}">
<hc:SimplePanel>
<uc:IconPannel x:Name="CustomIcon"/>
<hc:LoadingCircle x:Name="LoadingEle"/>
</hc:SimplePanel>
</hc:TabItem>
</hc:TabControl>
<hc:TabItem Tag="System" IsSelected="True" Header="系统图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource SystemIcon}" Style="{StaticResource TabTitle}">
<hc:SimplePanel>
<uc:IconPannel x:Name="SystemIcon"/>
</hc:SimplePanel>
</hc:TabItem>
<hc:TabItem Tag="Custom" Header="自定义图标" hc:IconElement.Height="16" hc:IconElement.Width="16" hc:IconElement.Geometry="{StaticResource CustomIcon}" Style="{StaticResource TabTitle}">
<hc:SimplePanel>
<uc:IconPannel x:Name="CustomIcon"/>
<hc:LoadingCircle x:Name="LoadingEle"/>
</hc:SimplePanel>
</hc:TabItem>
</hc:TabControl>
<Button Content="取消" Click="Close_Click" Margin="391,397.5,163,22.5"/>
<Button Content="自定义设置" Click="CustomButton_Click" IsEnabled="False" Name="CustomButton" Style="{StaticResource Btn1}" Margin="447,397.5,71,22.5"/>
<Button Content="确定" Click="Confirm_Click" Style="{StaticResource Btn1}" Margin="534,397.5,20,22.5" />
</Grid>
<Button Content="取消" Click="Close_Click" Margin="391,397.5,163,22.5"/>
<Button Content="自定义设置" Click="CustomButton_Click" IsEnabled="False" Name="CustomButton" Style="{StaticResource Btn1}" Margin="447,397.5,71,22.5"/>
<Button Content="确定" Click="Confirm_Click" Style="{StaticResource Btn1}" Margin="534,397.5,20,22.5" />
</Grid>
</hc:DialogContainer>
</Border>
</Grid>

View File

@@ -1,4 +1,5 @@
using GeekDesk.Control.Other;
using GeekDesk.Interface;
using GeekDesk.Util;
using GeekDesk.ViewModel;
@@ -17,7 +18,7 @@ namespace GeekDesk.Control.Windows
/// <summary>
/// IconfontWindow.xaml 的交互逻辑
/// </summary>
public partial class IconfontWindow : Window
public partial class IconfontWindow : Window, IWindowCommon
{
private static AppConfig appConfig = MainWindow.appData.AppConfig;
private static MenuInfo menuInfo;
@@ -71,7 +72,7 @@ namespace GeekDesk.Control.Windows
{
LoadingEle.Visibility = Visibility.Visible;
CustomIcon.Visibility = Visibility.Collapsed;
HandyControl.Controls.Dialog.Show(new CustomIconUrlDialog(appConfig));
HandyControl.Controls.Dialog.Show(new CustomIconUrlDialog(appConfig), "IconUrlDialog");
} else
{
if (customIcons == null)
@@ -132,6 +133,7 @@ namespace GeekDesk.Control.Windows
window = new IconfontWindow(listInfo, menuInfo);
}
window.Show();
Keyboard.Focus(window);
ShowWindowFollowMouse.Show(window, MousePosition.LEFT_CENTER, 0, 0, false);
}
@@ -172,6 +174,13 @@ namespace GeekDesk.Control.Windows
}
}
public void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
{
this.Close();
}
}
public class IconfontViewModel : INotifyPropertyChanged
{

View File

@@ -11,9 +11,12 @@
Height="450"
Width="510"
WindowStyle="None"
Title=""
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False"
>
Focusable="True"
KeyDown="OnKeyDown"
>
<Window.Resources>
<cvt:TodoTaskExecConvert x:Key="TodoTaskExecConvert"/>
</Window.Resources>

View File

@@ -1,4 +1,5 @@
using GeekDesk.Constant;
using GeekDesk.Interface;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using HandyControl.Controls;
@@ -22,7 +23,7 @@ namespace GeekDesk.Control.Windows
/// <summary>
/// BacklogInfoWindow.xaml 的交互逻辑
/// </summary>
public partial class ToDoInfoWindow
public partial class ToDoInfoWindow : IWindowCommon
{
private static int windowType = -1;
@@ -207,6 +208,7 @@ namespace GeekDesk.Control.Windows
{
window = new ToDoInfoWindow();
window.Show();
Keyboard.Focus(window);
}
window.Visibility = Visibility.Collapsed;
windowType = NEW_TODO;
@@ -222,6 +224,7 @@ namespace GeekDesk.Control.Windows
}
windowType = DETAIL_TODO;
window2.Show();
Keyboard.Focus(window2);
}
private void ExecType_Checked(object sender, RoutedEventArgs e)
@@ -239,5 +242,13 @@ namespace GeekDesk.Control.Windows
break;
}
}
public void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
{
this.Close();
}
}
}
}

View File

@@ -13,6 +13,8 @@
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False"
Focusable="True"
KeyDown="OnKeyDown"
>
<Grid Margin="50">

View File

@@ -1,4 +1,5 @@
using GeekDesk.Control.UserControls.Backlog;
using GeekDesk.Interface;
using GeekDesk.ViewModel;
using HandyControl.Controls;
using System;
@@ -21,7 +22,7 @@ namespace GeekDesk.Control.Windows
/// <summary>
/// BacklogWindow.xaml 的交互逻辑
/// </summary>
public partial class ToDoWindow
public partial class ToDoWindow : IWindowCommon
{
private static TodoControl backlog = new TodoControl();
private AppData appData = MainWindow.appData;
@@ -94,8 +95,15 @@ namespace GeekDesk.Control.Windows
window = new ToDoWindow();
}
window.Show();
Keyboard.Focus(window);
}
public void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
{
this.Close();
}
}
}
}

View File

@@ -9,7 +9,10 @@
Height="460" Width="610"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent" ShowInTaskbar="False">
Title=""
Background="Transparent" ShowInTaskbar="False"
Focusable="True"
KeyDown="OnKeyDown">
<Grid Margin="20">
<Grid.Effect>
<DropShadowEffect BlurRadius="30" Direction="-90" Color="Gray"

View File

@@ -1,4 +1,5 @@
using GeekDesk.Constant;
using GeekDesk.Interface;
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Newtonsoft.Json.Linq;
@@ -23,7 +24,7 @@ namespace GeekDesk.Control.Windows
/// <summary>
/// UpdateWindow.xaml 的交互逻辑
/// </summary>
public partial class UpdateWindow : Window
public partial class UpdateWindow : Window, IWindowCommon
{
private static AppConfig appConfig = MainWindow.appData.AppConfig;
private static string githubUrl = "";
@@ -103,6 +104,15 @@ namespace GeekDesk.Control.Windows
window = new UpdateWindow(jo);
}
window.Show();
Keyboard.Focus(window);
}
public void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
{
this.Close();
}
}
}
}

View File

@@ -189,6 +189,7 @@
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.cs" />
<Compile Include="DraggAnimatedPanel\DraggAnimatedPanel.Drag.cs" />
<Compile Include="Converts\HideTypeConvert.cs" />
<Compile Include="Interface\IWindowCommon.cs" />
<Compile Include="Task\ToDoTask.cs" />
<Compile Include="Thread\MouseHookThread.cs" />
<Compile Include="Thread\DispatcherBuild.cs" />

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
namespace GeekDesk.Interface
{
public interface IWindowCommon
{
void OnKeyDown(object sender, KeyEventArgs e);
}
}

View File

@@ -9,7 +9,7 @@
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:DraggAnimatedPanel="clr-namespace:DraggAnimatedPanel"
x:Name="window"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:viewmodel="clr-namespace:GeekDesk.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:AppData}"
Title="GeekDesk"
d:DesignHeight="500" d:DesignWidth="700"
WindowStyle="None"
@@ -19,6 +19,8 @@
Opacity="0"
Deactivated="Window_Deactivated"
SizeChanged="Window_SizeChanged"
KeyDown="OnKeyDown"
Focusable="True"
>
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="0" ResizeBorderThickness="15"/>
@@ -92,6 +94,7 @@
Click="ConfigButtonClick"
Initialized="SettingButton_Initialized"
x:Name="SettingButton"
FocusVisualStyle="{x:Null}"
>
<Button.ContextMenu>
<ContextMenu x:Name="SettingMenus" Width="130">
@@ -107,13 +110,15 @@
hc:IconElement.Width="18"
HorizontalAlignment="Right"
Click="CloseButtonClick"
FocusVisualStyle="{x:Null}"
/>
</hc:UniformSpacingPanel>
</DockPanel>
<uc:LeftCardControl Grid.Row="1" Grid.Column="0"/>
<uc:LeftCardControl Grid.Row="1" Grid.Column="0"/>
<!--分割线-->
<GridSplitter Opacity="0" Grid.Row="1" Grid.Column="0" Width="1" VerticalAlignment="Stretch" HorizontalAlignment="Right"/>

View File

@@ -3,6 +3,7 @@ using GeekDesk.Constant;
using GeekDesk.Control;
using GeekDesk.Control.UserControls.Config;
using GeekDesk.Control.Windows;
using GeekDesk.Interface;
using GeekDesk.Task;
using GeekDesk.Thread;
using GeekDesk.Util;
@@ -29,13 +30,10 @@ namespace GeekDesk
/// MainWindow.xaml 的交互逻辑
/// </summary>
///
public partial class MainWindow : Window
public partial class MainWindow : Window, IWindowCommon
{
//public IKeyboardMouseEvents m_GlobalHook = Hook.GlobalEvents();
public static AppData appData = CommonCode.GetAppDataByFile();
//public static ToDoInfoWindow toDoInfoWindow = (ToDoInfoWindow)ToDoInfoWindow.GetThis();
public static ToDoInfoWindow toDoInfoWindow;
public static int hotKeyId = -1;
public static int toDoHotKeyId = -1;
@@ -95,6 +93,7 @@ namespace GeekDesk
ShowApp();
}
//给任务栏图标一个名字
BarIcon.Text = Constants.MY_NAME;
//注册热键
@@ -108,36 +107,15 @@ namespace GeekDesk
}
//注册鼠标中键监听事件
//m_GlobalHook.MouseUpExt += M_GlobalHook_MouseUpExt;
MouseHookThread.MiddleHook();
if (appData.AppConfig.MouseMiddleShow)
{
MouseHookThread.MiddleHook();
}
//更新线程开启 检测更新
UpdateThread.Update();
}
/// <summary>
/// 鼠标中键呼出
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
//private void M_GlobalHook_MouseUpExt(object sender, System.Windows.Forms.MouseEventArgs e)
//{
// if (appData.AppConfig.MouseMiddleShow && e.Button == System.Windows.Forms.MouseButtons.Middle)
// {
// if (MotionControl.hotkeyFinished)
// {
// if (mainWindow.Visibility == Visibility.Collapsed || mainWindow.Opacity == 0)
// {
// ShowApp();
// }
// else
// {
// HideApp();
// }
// }
// }
//}
/// <summary>
/// 注册当前窗口的热键
/// </summary>
@@ -283,10 +261,6 @@ namespace GeekDesk
/// <param name="e"></param>
private void DragMove(object sender, MouseEventArgs e)
{
//if (e.LeftButton == MouseButtonState.Pressed)
//{
// this.DragMove();
//}
if (e.LeftButton == MouseButtonState.Pressed)
{
@@ -303,7 +277,6 @@ namespace GeekDesk
(When clicking the drag area, make the window follow) */
DragMove();
if (this.ResizeMode != windowMode)
{
this.ResizeMode = windowMode;
@@ -426,7 +399,10 @@ namespace GeekDesk
/// <param name="e"></param>
private void ExitApp(object sender, RoutedEventArgs e)
{
MouseHookThread.Dispose();
if (appData.AppConfig.MouseMiddleShow)
{
MouseHookThread.Dispose();
}
Application.Current.Shutdown();
}
@@ -526,6 +502,15 @@ namespace GeekDesk
{
appData.AppConfig.ShowBarIcon = false;
}
public void OnKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Escape)
{
HideApp();
}
}
}

View File

@@ -49,5 +49,5 @@ using System.Windows;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.3.2.0")]
[assembly: AssemblyFileVersion("2.3.2.0")]
[assembly: AssemblyVersion("2.3.2.1")]
[assembly: AssemblyFileVersion("2.3.2.1")]

View File

@@ -1,9 +1,9 @@
{
"title": "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"subTitle": "V2.3.20 <20><>ʽ<EFBFBD><CABD>",
"msgTitle": "<EFBFBD><EFBFBD><EFBFBD>θ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"msg": "['һ<EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>޸<EFBFBD><DEB8><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>bug<75><67><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˲<EFBFBD><CBB2>ֹ<EFBFBD><D6B9><EFBFBD>','<27>޸<EFBFBD><DEB8>޷<EFBFBD><DEB7>޸IJ˵<C4B2>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD>bug','<27>޸<EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״bug','<27>޸<EFBFBD><DEB8>ȼ<EFBFBD><C8BC><EFBFBD>֧<EFBFBD><D6A7>Alt<6C><74>bug','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><D0BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EAB9A6>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>star<61><72>']",
"title": "GeekDesk版本更新",
"subTitle": "V2.3.21",
"msgTitle": "本次更新内容如下",
"msg": "['所有窗口可Esc退出','修复一个测试遗留BUG,导致没有D盘的情况下无法添加项目','修复已知问题']",
"githubUrl": "https://github.com/Demo-Liu/GeekDesk/releases",
"giteeUrl": "https://gitee.com/demo_liu/GeekDesk/releases",
"version": "2.3.20"
"version": "2.3.21"
}

View File

@@ -1,9 +1,9 @@
{
"title": "版本更新",
"subTitle": "V2.3.20 正式版",
"msgTitle": "本次更新内容如下",
"msg": "['一个小更新, 修复了一部分bug并增加了部分功能','修复无法修改菜单图标的bug','修复图标锯齿状bug','修复热键不支持Alt的bug','增加鼠标中键呼出功能','增加隐藏托盘图标功能','界面美化等','最后去给我点个star呗']",
"title": "GeekDesk<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"subTitle": "V2.3.21",
"msgTitle": "<EFBFBD><EFBFBD><EFBFBD>θ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",
"msg": "['<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD>ڿ<EFBFBD>Esc<EFBFBD>˳<EFBFBD>','<27>޸<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>BUG,<2C><><EFBFBD><EFBFBD>û<EFBFBD><C3BB>D<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ','<27>޸<EFBFBD><DEB8><EFBFBD>֪<EFBFBD><D6AA><EFBFBD><EFBFBD>']",
"githubUrl": "https://github.com/Demo-Liu/GeekDesk/releases",
"giteeUrl": "https://gitee.com/demo_liu/GeekDesk/releases",
"version": "2.3.20"
"version": "2.3.21"
}

View File

@@ -74,7 +74,6 @@ namespace GeekDesk.Util
myEncoderParameters.Param[0] = myEncoderParameter;
bmp.Save(strm, myImageCodecInfo, myEncoderParameters);
bmp.Save("d:\\test.png", myImageCodecInfo, myEncoderParameters);
BitmapImage bmpImage = new BitmapImage();
bmpImage.BeginInit();
strm.Seek(0, SeekOrigin.Begin);

View File

@@ -4,6 +4,7 @@ using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
@@ -13,6 +14,7 @@ namespace GeekDesk.Util
{
class ImageUtil
{
private static readonly string SYSTEM_ITEM = "::{.*}";
/// <summary>
/// 图片数组转 BitmapImage
@@ -84,7 +86,7 @@ namespace GeekDesk.Util
/// <returns></returns>
public static BitmapImage GetBitmapIconByPath(string filePath)
{
if (File.Exists(filePath))
if (File.Exists(filePath) || IsSystemItem(filePath))
{
if (IsImage(filePath)) {
//图片
@@ -334,5 +336,15 @@ namespace GeekDesk.Util
}
/// <summary>
/// 判断是否为系统项
/// </summary>
/// <returns></returns>
public static bool IsSystemItem(string path)
{
return Regex.IsMatch(path, SYSTEM_ITEM);
}
}
}