8 Commits

Author SHA1 Message Date
liufei
cbaeb71a0c 🧑‍💻 配置文件控制公众号显示 2022-06-17 10:20:36 +08:00
liufei
b8a6c9b91d 🚑 更新信息 2022-06-17 10:05:34 +08:00
liufei
001d807bb3 🐛 修复了某些路径无法建立相对路径导致程序启动崩溃的bug 2022-06-17 10:03:35 +08:00
liufei
240008ce2c :bug:修改提示 2022-06-15 17:40:43 +08:00
liufei
8f043ffd05 ♻️ 优化贴边隐藏的动画时间 2022-06-14 11:49:46 +08:00
liufei
6e58afcdea ♻️ 优化动画及部分样式 2022-06-14 10:37:24 +08:00
liufei
896dc26f11 🐛 修复路径可能为空导致创建相对路径报错的问题 2022-06-14 09:48:13 +08:00
liufei
d44cc90100 💥 2.5.10 2022-06-13 20:59:31 +08:00
19 changed files with 192 additions and 152 deletions

View File

@@ -54,14 +54,15 @@
</assemblyBinding>
</runtime>
<appSettings>
<add key="Version" value="2.4.17" />
<add key="Version" value="2.5.11" />
<add key="GitHubUrl" value="https://github.com/BookerLiu/GeekDesk" />
<add key="GiteeUrl" value="https://gitee.com/BookerLiu/GeekDesk/tree/master" />
<add key="GitHubUpdateUrl" value="https://raw.githubusercontent.com/BookerLiu/GeekDesk/master/Update.json" />
<add key="GiteeUpdateUrl" value="https://gitee.com/BookerLiu/GeekDesk/raw/master/Update.json" />
<!--<add key="GiteeUpdateUrl" value="file:///C:/Users/Fei/Desktop/GeekDesk/Update.json" />-->
<!--<add key="GiteeUpdateUrl" value="file:///D:/WorkSpace/workspace-VS/GeekDesk/Update.json" />-->
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="CustomIconTeachUrl" value="https://mp.weixin.qq.com/s/LxoHAekho9HBVl4FRw_Law" />
<add key="ShowPublicWeChat" value="Y"/>
</appSettings>
<system.web>
<membership defaultProvider="ClientAuthenticationMembershipProvider">

View File

@@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cvt="clr-namespace:GeekDesk.Converts"
xmlns:xf="clr-namespace:XamlFlair;assembly=XamlFlair.WPF"
xmlns:local="clr-namespace:GeekDesk.Control.UserControls.PannelCard"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
@@ -16,7 +17,11 @@
<Grid MouseDown="DragMove">
<hc:SimplePanel Margin="20,50,20,20" >
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
<Image Source="/Resource/Image/About.png" Width="400" Height="100"/>
<Image Source="/Resource/Image/About.png"
Width="400"
Height="100"
xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndContract}, Delay=250}"
/>
<TextBlock x:Name="AppInfo" TextAlignment="Center" Text="Copyright © 2021 GeekDesk V"/>
<hc:UniformSpacingPanel Spacing="5" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Center">
<hc:Shield Subject=".net" Status=">=4.72" Margin="0,0,10,0" Color="#1182c3"/>
@@ -27,18 +32,21 @@
MouseLeave="SC_MouseLeave"
Command="hc:ControlCommands.OpenLink"
CommandParameter="https://github.com/BookerLiu/GeekDesk"
Margin="0,0,10,0" Color="#24292F"/>
Margin="0,0,10,0" Color="#24292F"
/>
<hc:Shield Subject="Gitee" Visibility="Visible" Status="Star"
MouseEnter="SC_MouseEnter"
MouseLeave="SC_MouseLeave"
Command="hc:ControlCommands.OpenLink"
CommandParameter="https://gitee.com/BookerLiu/GeekDesk"
Margin="0,0,10,0" Color="#C71D23"/>
Margin="0,0,10,0" Color="#C71D23"
/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" HorizontalAlignment="Center" Margin="0,5,0,0">
<hc:Shield Subject="公众号" Visibility="Visible" Status="抓几个娃" Margin="0,0,5,0" Color="#04913B">
<hc:Shield x:Name="PublicWeChatPanel" Subject="公众号" Visibility="Visible" Status="抓几个娃" Margin="0,0,5,0" Color="#04913B">
<hc:Poptip.Instance>
<hc:Poptip PlacementType="Top">
<hc:Poptip.Content>

View File

@@ -16,6 +16,15 @@ namespace GeekDesk.Control.UserControls.Config
{
InitializeComponent();
AppInfo.Text += ConfigurationManager.AppSettings["Version"];
string showPublicWeChat = ConfigurationManager.AppSettings["ShowPublicWeChat"];
if ("Y".Equals(showPublicWeChat))
{
PublicWeChatPanel.Visibility = Visibility.Visible;
} else
{
PublicWeChatPanel.Visibility = Visibility.Collapsed;
}
PublicWeChat.Source = ImageUtil.Base64ToBitmapImage(Constants.PUBLIC_WE_CHAT_IMG_BASE64);
WeChatCode.Source = ImageUtil.Base64ToBitmapImage(Constants.WE_CHAT_CODE_IMG_BASE64);
ZFBCode.Source = ImageUtil.Base64ToBitmapImage(Constants.ZFB_CODE_IMG_BASE64);

View File

@@ -84,15 +84,7 @@
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
<CheckBox Content="主窗口动画效果" IsChecked="{Binding AppAnimation}" Click="Animation_Checked">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
<TextBlock Text="面板关闭方式" VerticalAlignment="Center"/>

View File

@@ -306,14 +306,6 @@ namespace GeekDesk.Control.UserControls.Config
}
}
private void Animation_Checked(object sender, RoutedEventArgs e)
{
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed)
{
appConfig.IsShow = true;
}
appConfig.IsShow = null;
}
/// <summary>

View File

@@ -111,6 +111,24 @@
<hc:Divider LineStrokeDashArray="3,3" Margin="0,0,0,0" Height="20" LineStroke="Black" Grid.ColumnSpan="1"/>
<hc:UniformSpacingPanel Spacing="10" Margin="5,-10,0,0" Grid.ColumnSpan="4">
<CheckBox Content="主窗口动画" IsChecked="{Binding AppAnimation}" Click="Animation_Checked">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
<CheckBox Content="列表展开动画" IsChecked="{Binding ItemSpradeAnimation}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
<CheckBox x:Name="BarIcon" Content="显示托盘图标" IsChecked="{Binding ShowBarIcon}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
@@ -120,7 +138,7 @@
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="5,5,0,0" Grid.ColumnSpan="4">
<hc:UniformSpacingPanel Spacing="10" Margin="5,10,0,0" Grid.ColumnSpan="4">
<CheckBox Content="显示主面板Logo" IsChecked="{Binding TitleLogoVisible, Mode=TwoWay, Converter={StaticResource Visibility2BooleanConverter}}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">

View File

@@ -157,5 +157,16 @@ namespace GeekDesk.Control.UserControls.Config
GradientBGDialog gbg = new GradientBGDialog();
gbg.dialog = HandyControl.Controls.Dialog.Show(gbg, "ConfigWindowDialog");
}
private void Animation_Checked(object sender, RoutedEventArgs e)
{
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed)
{
appConfig.IsShow = true;
}
appConfig.IsShow = null;
}
}
}

View File

@@ -311,7 +311,11 @@ namespace GeekDesk.Control.UserControls.PannelCard
{
if (RunTimeStatus.IS_MENU_EDIT) return;
if (appData.AppConfig.ItemSpradeAnimation)
{
//是否启用列表展开动画
MainWindow.mainWindow.RightCard.WrapUFG.Visibility = Visibility.Collapsed;
}
//设置对应菜单的图标列表
if (MenuListBox.SelectedIndex == -1)

View File

@@ -112,7 +112,7 @@
</hc:Card.ContextMenu>
<hc:DialogContainer>
<Grid>
<ot:PasswordDialog xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility}"
<ot:PasswordDialog xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndGrowHorizontally}, Event=Visibility, Duration=50, Delay=0}"
x:Name="PDDialog"
Panel.ZIndex="99"
IsVisibleChanged="PDDialog_IsVisibleChanged"

View File

@@ -110,7 +110,7 @@
</hc:SideMenu>
</hc:Card>
<hc:ScrollViewer Grid.Row="0" Grid.Column="1" BorderThickness="0" Margin="0,5,1,5">
<UniformGrid x:Name="UFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeInAndSlideFromLeft}, Event=Visibility}">
<UniformGrid x:Name="UFG" xf:Animations.Primary="{xf:Animate BasedOn={StaticResource FadeIn}, Event=Visibility, Delay=0}">
<!--<hc:TransitioningContentControl TransitionMode="Left2RightWithFade">-->
<hc:Card x:Name="RightCard" BorderThickness="0" MouseDown="DragMove">
<hc:Card.Background>

View File

@@ -49,7 +49,7 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
@@ -57,6 +57,8 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Prefer32Bit>false</Prefer32Bit>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
</PropertyGroup>
<PropertyGroup>
<StartupObject>GeekDesk.App</StartupObject>
@@ -263,6 +265,7 @@
<Compile Include="Converts\HideTypeConvert.cs" />
<Compile Include="Interface\IWindowCommon.cs" />
<Compile Include="MyThread\RelativePathThread.cs" />
<Compile Include="Task\ShowSecondTask.cs" />
<Compile Include="Task\ToDoTask.cs" />
<Compile Include="MyThread\MouseHookThread.cs" />
<Compile Include="MyThread\DispatcherBuild.cs" />

View File

@@ -185,7 +185,7 @@ namespace GeekDesk
{
ShowApp();
}
//ShowSecondTask.SHowSecond();
//给任务栏图标一个名字
BarIcon.Text = Constants.MY_NAME;
@@ -426,17 +426,6 @@ namespace GeekDesk
// return;
//}
MainWindow.mainWindow.Activate();
mainWindow.Show();
//mainWindow.Visibility = Visibility.Visible;
if (appData.AppConfig.AppAnimation)
{
appData.AppConfig.IsShow = true;
} else
{
appData.AppConfig.IsShow = null;
}
if (MarginHide.ON_HIDE)
{
//修改贴边隐藏状态为未隐藏
@@ -453,6 +442,18 @@ namespace GeekDesk
ShowWindowFollowMouse.Show(mainWindow, MousePosition.CENTER, 0, 0);
}
MainWindow.mainWindow.Activate();
mainWindow.Show();
//mainWindow.Visibility = Visibility.Visible;
if (appData.AppConfig.AppAnimation)
{
appData.AppConfig.IsShow = true;
}
else
{
appData.AppConfig.IsShow = null;
}
//FadeStoryBoard(1, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Visible);

View File

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

31
Task/ShowSecondTask.cs Normal file
View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace GeekDesk.Task
{
internal class ShowSecondTask
{
public static void SHowSecond()
{
System.Timers.Timer timer = new System.Timers.Timer
{
Enabled = true,
Interval = 5000
};
timer.Start();
timer.Elapsed += Timer_Elapsed;
}
private static void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
Process[] pcArr = Process.GetProcessesByName("ShellExperienceHost.exe");
Thread.Sleep(1000);
}
}
}

View File

@@ -1,9 +1,9 @@
{
"title": "GeekDesk版本更新",
"subTitle": "V2.4.16",
"subTitle": "V2.5.11",
"msgTitle": "本次更新内容如下",
"msg": "['兄弟萌求Star, 求Star, 由于功能越来越多, 之后的更新我会测试一周再发布, 尽量做到没有BUG, 见谅', '这个版本没有功能性改变, 主要是为了修复上个版本的bug', '修复无法修改菜单名称的问题', '修复通过任务栏图标打开拾色器, 图标菜单消失问题']",
"msg": "['依旧耗费了我大量精力开发,希望大家去给我点个免费的Star', '这个版本有一些优化点, 大家可以自行探索, 另外征集新Logo的设计, 要求美观并能体现\\'极客\\'风格','本次重新打包了程序文件(文件目录更清爽了,注意,这次不要使用覆盖升级(2.5.10可覆盖)), 可以将旧版本根目录下的Data文件复制到新版本根目录, 然后使用新版本启动','修复了2.5.10版本部分相对路径创建导致启动崩溃的bug','增加可拖动图标到其它菜单的功能,取消了拖动时的动画','增加了列表展开动画的开关','增加了数据备份功能','优化大部分动画','优化搜索功能(达到了可只用键盘或只用鼠标启动所需目标)','增加了相对路径(实验性,可能有bug)','增加列表加密功能(实验性,可能有bug)','其它已知问题修复']",
"githubUrl": "https://github.com/BookerLiu/GeekDesk/releases",
"giteeUrl": "https://gitee.com/BookerLiu/GeekDesk/releases",
"version": "2.4.16"
"version": "2.5.11"
}

View File

@@ -159,30 +159,23 @@ namespace GeekDesk.Util
public static string MakeRelativePath(string fromPath, string toPath)
{
//if (string.IsNullOrEmpty(fromPath)) throw new ArgumentNullException("fromPath");
//if (string.IsNullOrEmpty(toPath)) throw new ArgumentNullException("toPath");
//Uri fromUri = new Uri(fromPath);
//Uri toUri = new Uri(toPath);
//if (fromUri.Scheme != toUri.Scheme) { return toPath; } // path can't be made relative.
//Uri relativeUri = fromUri.MakeRelativeUri(toUri);
//string relativePath = Uri.UnescapeDataString(relativeUri.ToString());
//if (toUri.Scheme.Equals("file", StringComparison.InvariantCultureIgnoreCase))
//{
// relativePath = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
//}
string relativePath = null;
try
{
if (string.IsNullOrEmpty(toPath) || string.IsNullOrEmpty(fromPath)) return null;
Uri file = new Uri(@toPath);
// Must end in a slash to indicate folder
Uri folder = new Uri(@fromPath);
string relativePath =
relativePath =
Uri.UnescapeDataString(
folder.MakeRelativeUri(file)
.ToString()
.Replace('/', Path.DirectorySeparatorChar)
);
} catch (Exception ex)
{
LogUtil.WriteErrorLog(ex, "建立相对路径出错:fromPath:" + fromPath + ",toPath:" + toPath);
}
return relativePath;
}

View File

@@ -25,8 +25,8 @@ namespace GeekDesk.Util
{
private static Window window;//定义使用该方法的窗体
private static readonly int hideTime = 50;
private static readonly int showTime = 30;
private static readonly int hideTime = 65;
private static readonly int showTime = 15;
private static int animalTime;
@@ -127,7 +127,7 @@ namespace GeekDesk.Util
else if (mouseX >= windowLeft && mouseX <= windowLeft + windowWidth
&& mouseY >= windowTop && mouseY <= windowTop + windowHeight && IS_HIDE && window.Visibility != Visibility.Visible)
{
window.Visibility = Visibility.Visible;
window.Show();
//上方显示
if (windowTop <= screenTop - showMarginWidth)
{
@@ -227,17 +227,30 @@ namespace GeekDesk.Util
{
App.Current.Dispatcher.Invoke(() =>
{
double abs = Math.Abs(Math.Abs(to) - Math.Abs(from));
double subLen = abs / hideTime;
if ((int)hideType <= 3)
switch (hideType)
{
case HideType.LEFT_SHOW:
to -= 20;
break;
case HideType.RIGHT_SHOW:
to += 20;
break;
case HideType.TOP_SHOW:
to -= 20;
break;
}
double abs = Math.Abs(Math.Abs(to) - Math.Abs(from));
if (hideType <= HideType.RIGHT_SHOW)
{
animalTime = showTime;
} else
{
animalTime = hideTime;
}
double subLen = abs / animalTime;
int count = 0;
while (count < animalTime)
{
@@ -268,86 +281,20 @@ namespace GeekDesk.Util
switch (hideType)
{
case HideType.LEFT_HIDE:
window.Left = to;
break;
case HideType.LEFT_SHOW:
window.Left = to - 20;
break;
case HideType.RIGHT_HIDE:
window.Left = to;
break;
case HideType.RIGHT_SHOW:
window.Left = to + 20;
break;
case HideType.TOP_HIDE:
window.Top = to;
break;
case HideType.TOP_SHOW:
window.Top = to - 20;
window.Top = to;
break;
default:
window.Left = to;
break;
}
if (hideType > HideType.RIGHT_SHOW)
{
window.Visibility = Visibility.Collapsed;
}
//double toTemp = to;
//double leftT = 0;
//double topT = 0;
//switch (hideType)
//{
// case HideType.LEFT_HIDE:
// to += leftT;
// break;
// case HideType.LEFT_SHOW:
// to -= leftT;
// break;
// case HideType.RIGHT_HIDE:
// to -= leftT;
// break;
// case HideType.RIGHT_SHOW:
// to += leftT;
// break;
// case HideType.TOP_HIDE:
// to += topT;
// break;
// case HideType.TOP_SHOW:
// to -= topT;
// break;
//}
//DoubleAnimation da = new DoubleAnimation
//{
// From = from,
// To = to,
// Duration = new Duration(TimeSpan.FromMilliseconds(hideTime))
//};
//// 如果是显示 则贴屏幕侧不显示阴影
//bool isShow = false;
//int shadowWidthTemp = Constants.SHADOW_WIDTH;
//if (hideType <= HideType.RIGHT_SHOW)
//{
// isShow = true;
// if (hideType == HideType.RIGHT_SHOW)
// {
// shadowWidthTemp = -shadowWidthTemp;
// }
//}
//da.Completed += (s, e) =>
//{
// if ("Top".Equals(property.Name))
// {
// window.Top = isShow ? toTemp - shadowWidthTemp : toTemp;
// }
// else
// {
// window.Left = isShow ? toTemp - shadowWidthTemp : toTemp;
// }
// window.BeginAnimation(property, null);
//};
//Timeline.SetDesiredFrameRate(da, 60);
//window.BeginAnimation(property, da);
});
}).Start();

View File

@@ -101,8 +101,22 @@ namespace GeekDesk.ViewModel
private bool? isShow;
private bool itemSpradeAnimation; //列表展开动画
#region GetSet
public bool ItemSpradeAnimation
{
get
{
return itemSpradeAnimation;
}
set
{
itemSpradeAnimation = value;
OnPropertyChanged("ItemSpradeAnimation");
}
}
public bool? IsShow
{
get

View File

@@ -205,6 +205,14 @@ namespace GeekDesk.ViewModel
set
{
name = value;
if (StringUtil.IsEmpty(Path))
{
content = Name + "\n使用次数: " + Count;
}
else
{
content = Path + "\n" + Name + "\n使用次数: " + Count;
}
}
}
@@ -238,6 +246,14 @@ namespace GeekDesk.ViewModel
set
{
path = value;
if (StringUtil.IsEmpty(Path))
{
content = Name + "\n使用次数: " + Count;
}
else
{
content = Path + "\n" + Name + "\n使用次数: " + Count;
}
}
}