'边缘吸附功能','窗口淡入淡出动画','待办任务快捷键(默认Ctrl+Shift+Q)','右键任务栏图标打开程序目录菜单'
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<hc:SimplePanel Margin="20,50,20,20" >
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||
<Image Source="/Resource/Image/About.png" Width="400" Height="100"/>
|
||||
<TextBlock x:Name="AppInfo" TextAlignment="Center" Text="Copyright © 2021 GeekDesk "/>
|
||||
<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"/>
|
||||
<hc:Shield Subject="IDE" Status="VS2019" Margin="0,0,10,0" Color="#1182c3"/>
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
<cvt:HideTypeConvert x:Key="HideTypeConvert"/>
|
||||
</UserControl.Resources>
|
||||
<Grid Background="AliceBlue" MouseDown="DragMove">
|
||||
<hc:SimplePanel Margin="20" >
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,0,10" Grid.ColumnSpan="4">
|
||||
<StackPanel Margin="10">
|
||||
<hc:UniformSpacingPanel Spacing="10" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="面板动作设置" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,26.394,0,-16.394" Grid.ColumnSpan="4">
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||
<CheckBox x:Name="IconIsAdmin" Content="启动时显示主面板" IsChecked="{Binding StartedShowPanel}">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
@@ -27,7 +27,7 @@
|
||||
</CheckBox>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,50,0,-102.337" Grid.ColumnSpan="4">
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||
<CheckBox Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
@@ -36,10 +36,31 @@
|
||||
</CheckBox.Background>
|
||||
</CheckBox>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,89.49,-30,-79.49" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="面板关闭方式" VerticalAlignment="Center" Margin="-26,0,26,0"/>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||
<CheckBox Content="贴边隐藏" IsChecked="{Binding MarginHide}" Checked="MarginHide_Changed" Unchecked="MarginHide_Changed">
|
||||
<CheckBox.Background>
|
||||
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
|
||||
<GradientStop Color="#FF9EA3A6"/>
|
||||
</LinearGradientBrush>
|
||||
</CheckBox.Background>
|
||||
</CheckBox>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,115,20,-102.337" Grid.ColumnSpan="4">
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||
<CheckBox Content="主窗口动画效果" IsChecked="{Binding AppAnimation}" Checked="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"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
|
||||
Style="{StaticResource RadioButtonIcon}" Content="失去焦点后"
|
||||
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=1}"/>
|
||||
@@ -51,11 +72,11 @@
|
||||
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=3}"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,164.49,-30,-154.49" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="热键设置" VerticalAlignment="Center" Margin="-26,0,26,0"/>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="0,10,0,0" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="热键设置" VerticalAlignment="Center"/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="30,193,0,-180.337" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="主面板:" Width="55"/>
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="主面板:" VerticalAlignment="Center" Width="55"/>
|
||||
<hc:TextBox HorizontalAlignment="Left"
|
||||
Tag="Main"
|
||||
VerticalAlignment="Top"
|
||||
@@ -65,9 +86,9 @@
|
||||
Text="{Binding HotkeyStr}"
|
||||
KeyDown="HotKeyDown"
|
||||
KeyUp="HotKeyUp"
|
||||
Margin="12.967,-7.38,-12.967,0"/>
|
||||
/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<!--<hc:UniformSpacingPanel Spacing="10" Margin="30,229,0,-216.337" Grid.ColumnSpan="4">
|
||||
<hc:UniformSpacingPanel Spacing="10" Margin="10,5,0,0" Grid.ColumnSpan="4">
|
||||
<TextBlock Text="新建待办:" Width="55"/>
|
||||
<hc:TextBox HorizontalAlignment="Left"
|
||||
Tag="ToDo"
|
||||
@@ -78,10 +99,10 @@
|
||||
Text="{Binding ToDoHotkeyStr}"
|
||||
KeyDown="HotKeyDown"
|
||||
KeyUp="HotKeyUp"
|
||||
Margin="12.967,-7.38,-12.967,0"/>
|
||||
</hc:UniformSpacingPanel>-->
|
||||
/>
|
||||
</hc:UniformSpacingPanel>
|
||||
<StackPanel hc:Growl.GrowlParent="True" hc:Growl.Token="HotKeyGrowl" VerticalAlignment="Top"/>
|
||||
</hc:SimplePanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using GeekDesk.Control.Windows;
|
||||
using GeekDesk.Constant;
|
||||
using GeekDesk.Control.Windows;
|
||||
using GeekDesk.Util;
|
||||
using GeekDesk.ViewModel;
|
||||
using HandyControl.Data;
|
||||
@@ -19,6 +20,7 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using static GeekDesk.Util.GlobalHotKey;
|
||||
|
||||
namespace GeekDesk.Control.UserControls.Config
|
||||
{
|
||||
@@ -212,14 +214,16 @@ namespace GeekDesk.Control.UserControls.Config
|
||||
{
|
||||
if (MainWindow.hotKeyId != -1)
|
||||
{
|
||||
Hotkey.UnRegist(new WindowInteropHelper(MainWindow.mainWindow).Handle, Hotkey.keymap[MainWindow.hotKeyId]);
|
||||
//Hotkey.UnRegist(new WindowInteropHelper(MainWindow.mainWindow).Handle, Hotkey.keymap[MainWindow.hotKeyId]);
|
||||
GlobalHotKey.Dispose(MainWindow.hotKeyId);
|
||||
}
|
||||
MainWindow.RegisterHotKey(false);
|
||||
} else
|
||||
{
|
||||
if (MainWindow.toDoHotKeyId != -1)
|
||||
{
|
||||
Hotkey.UnRegist(new WindowInteropHelper(MainWindow.toDoInfoWindow).Handle, Hotkey.keymap[MainWindow.toDoHotKeyId]);
|
||||
//Hotkey.UnRegist(new WindowInteropHelper(MainWindow.toDoInfoWindow).Handle, Hotkey.keymap[MainWindow.toDoHotKeyId]);
|
||||
GlobalHotKey.Dispose(MainWindow.toDoHotKeyId);
|
||||
}
|
||||
MainWindow.RegisterCreateToDoHotKey(false);
|
||||
}
|
||||
@@ -242,66 +246,30 @@ namespace GeekDesk.Control.UserControls.Config
|
||||
}
|
||||
}
|
||||
|
||||
//private void ShowApp(MainWindow mainWindow)
|
||||
//{
|
||||
// if (appConfig.FollowMouse)
|
||||
// {
|
||||
// ShowAppAndFollowMouse(mainWindow);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// this.Visibility = Visibility.Visible;
|
||||
// }
|
||||
// Keyboard.Focus(this);
|
||||
//}
|
||||
private void MarginHide_Changed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (appConfig.MarginHide)
|
||||
{
|
||||
MainWindow.hide.TimerSet();
|
||||
} else
|
||||
{
|
||||
if (MainWindow.hide.timer != null)
|
||||
{
|
||||
MainWindow.hide.TimerStop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 随鼠标位置显示面板 (鼠标始终在中间)
|
||||
///// </summary>
|
||||
//private void ShowAppAndFollowMouse(MainWindow mainWindow)
|
||||
//{
|
||||
// //获取鼠标位置
|
||||
// System.Windows.Point p = MouseUtil.GetMousePosition();
|
||||
// double left = SystemParameters.VirtualScreenLeft;
|
||||
// double top = SystemParameters.VirtualScreenTop;
|
||||
// double width = SystemParameters.VirtualScreenWidth;
|
||||
// double height = SystemParameters.VirtualScreenHeight;
|
||||
// double right = width - Math.Abs(left);
|
||||
// double bottom = height - Math.Abs(top);
|
||||
private void Animation_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (MainWindow.mainWindow.Visibility == Visibility.Collapsed)
|
||||
{
|
||||
MainWindow.mainWindow.Visibility = Visibility.Visible;
|
||||
// 执行一下动画 防止太过突兀
|
||||
MainWindow.FadeStoryBoard(0, (int)CommonEnum.WINDOW_ANIMATION_TIME, Visibility.Collapsed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if (p.X - mainWindow.Width / 2 < left)
|
||||
// {
|
||||
// //判断是否在最左边缘
|
||||
// mainWindow.Left = left;
|
||||
// }
|
||||
// else if (p.X + mainWindow.Width / 2 > right)
|
||||
// {
|
||||
// //判断是否在最右边缘
|
||||
// mainWindow.Left = right - mainWindow.Width;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// mainWindow.Left = p.X - mainWindow.Width / 2;
|
||||
// }
|
||||
|
||||
|
||||
// if (p.Y - mainWindow.Height / 2 < top)
|
||||
// {
|
||||
// //判断是否在最上边缘
|
||||
// mainWindow.Top = top;
|
||||
// }
|
||||
// else if (p.Y + mainWindow.Height / 2 > bottom)
|
||||
// {
|
||||
// //判断是否在最下边缘
|
||||
// mainWindow.Top = bottom - mainWindow.Height;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// mainWindow.Top = p.Y - mainWindow.Height / 2;
|
||||
// }
|
||||
|
||||
// mainWindow.Visibility = Visibility.Visible;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
MouseEnter="StackPanel_MouseEnter"
|
||||
MouseLeave="StackPanel_MouseLeave"
|
||||
>
|
||||
<Image CacheMode="{Binding BitmapCache}" Style="{StaticResource ImageStyle}"/>
|
||||
<Image Style="{StaticResource ImageStyle}"/>
|
||||
<TextBlock MaxWidth="80"
|
||||
Margin="0,5,0,0"
|
||||
MaxHeight="40"
|
||||
|
||||
@@ -130,15 +130,35 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
p.StartInfo.ErrorDialog = false;
|
||||
if (appData.AppConfig.AppHideType == AppHideType.START_EXE)
|
||||
{
|
||||
Window parentWin = Window.GetWindow(this);
|
||||
parentWin.Visibility = Visibility.Collapsed;
|
||||
//如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
|
||||
if (appData.AppConfig.MarginHide)
|
||||
{
|
||||
if (!MainWindow.hide.IsMargin())
|
||||
{
|
||||
MainWindow.mainWindow.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow.mainWindow.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
}
|
||||
break;// c#好像不能case穿透
|
||||
case IconStartType.DEFAULT_STARTUP:
|
||||
if (appData.AppConfig.AppHideType == AppHideType.START_EXE)
|
||||
{
|
||||
Window parentWin = Window.GetWindow(this);
|
||||
parentWin.Visibility = Visibility.Collapsed;
|
||||
//如果开启了贴边隐藏 则窗体不贴边才隐藏窗口
|
||||
if (appData.AppConfig.MarginHide)
|
||||
{
|
||||
if (!MainWindow.hide.IsMargin())
|
||||
{
|
||||
MainWindow.mainWindow.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
} else
|
||||
{
|
||||
MainWindow.mainWindow.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case IconStartType.SHOW_IN_EXPLORE:
|
||||
@@ -243,16 +263,16 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
|
||||
private void StackPanel_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
ImgStroyBoard(sender, (int)CommonEnum.IMAGE_HEIGHT_AM, (int)CommonEnum.IMAGE_WIDTH_AM, 1);
|
||||
ImgStoryBoard(sender, (int)CommonEnum.IMAGE_HEIGHT_AM, (int)CommonEnum.IMAGE_WIDTH_AM, 1);
|
||||
}
|
||||
|
||||
private void StackPanel_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
ImgStroyBoard(sender, (int)CommonEnum.IMAGE_HEIGHT, (int)CommonEnum.IMAGE_WIDTH, 500);
|
||||
ImgStoryBoard(sender, (int)CommonEnum.IMAGE_HEIGHT, (int)CommonEnum.IMAGE_WIDTH, 220);
|
||||
}
|
||||
|
||||
|
||||
private void ImgStroyBoard(object sender, int height, int width, int milliseconds)
|
||||
private void ImgStoryBoard(object sender, int height, int width, int milliseconds)
|
||||
{
|
||||
|
||||
if (appData.AppConfig.PMModel) return;
|
||||
@@ -278,6 +298,9 @@ namespace GeekDesk.Control.UserControls.PannelCard
|
||||
Timeline.SetDesiredFrameRate(heightAnimation, 60);
|
||||
Timeline.SetDesiredFrameRate(widthAnimation, 60);
|
||||
|
||||
img.BeginAnimation(HeightProperty, null);
|
||||
img.BeginAnimation(WidthProperty, null);
|
||||
|
||||
img.BeginAnimation(HeightProperty, heightAnimation);
|
||||
img.BeginAnimation(WidthProperty, widthAnimation);
|
||||
}
|
||||
|
||||
@@ -149,6 +149,18 @@ namespace GeekDesk.Control.Windows
|
||||
window.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
public static void ShowOrHide()
|
||||
{
|
||||
if (window == null || !window.Activate())
|
||||
{
|
||||
window = new ToDoInfoWindow();
|
||||
window.Show();
|
||||
} else
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static System.Windows.Window GetThis()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user