下班喽

This commit is contained in:
liufei
2021-05-31 17:31:16 +08:00
parent 5faf6e11b2
commit 9a45899b47
15 changed files with 354 additions and 184 deletions

View File

@@ -9,6 +9,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/GeekDesk;component/Resource/Dictionary/Geometry.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
</ResourceDictionary.MergedDictionaries>

View File

@@ -13,7 +13,22 @@
Background="Transparent"
>
<Border CornerRadius="8" BorderThickness="0">
<Window.Resources>
<Style x:Key="MenuStyle" TargetType="hc:SideMenuItem" BasedOn="{StaticResource SideMenuItemBaseStyle}">
<Style.Setters>
<Setter Property="Background" Value="AliceBlue"/>
</Style.Setters>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FFE2E2E2"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#FFDAD7D7"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Border CornerRadius="8" BorderThickness="0">
<Border.Background>
<SolidColorBrush Color="AliceBlue" Opacity="0.9"/>
</Border.Background>
@@ -27,28 +42,53 @@
</Grid.ColumnDefinitions>
<hc:Card Grid.Row="0" Grid.Column="0">
<hc:SideMenu BorderThickness="1" AutoSelect="True" Header="WorkItems" BorderBrush="#FF958F8F">
<hc:Interaction.Triggers>
<hc:EventTrigger EventName="SelectionChanged">
<hc:EventToCommand Command="{Binding SwitchItemCmd}" PassEventArgsToCommand="True" />
</hc:EventTrigger>
</hc:Interaction.Triggers>
<hc:SideMenuItem Header="Work Items" Background="#FFD1C8C8">
<hc:SideMenu BorderThickness="1"
AutoSelect="True"
>
<hc:SideMenu.Background>
<SolidColorBrush Color="AliceBlue"/>
</hc:SideMenu.Background>
<hc:SideMenu.ItemContainerStyle>
<Style TargetType="hc:SideMenuItem" BasedOn="{StaticResource MenuStyle}"/>
</hc:SideMenu.ItemContainerStyle>
<hc:SideMenuItem Header="关于"
IsSelected="True"
Selected="MemuClick"
Tag="About"
>
<hc:SideMenuItem.Icon>
<Button Background="Transparent"
BorderThickness="0"
hc:IconElement.Geometry="M828.770654 148.714771C641.293737-20.89959 354.184117-19.590868 168.245698 152.630946c-212.062907 196.418185-212.062907 522.329912 0 718.748098 185.93842 172.221815 473.048039 173.520546 660.524956 3.916176 219.435707-198.536117 219.435707-528.054322 0-726.580449z m-121.880976 569.643707c-11.708566 11.708566-30.680039 11.708566-42.388605 0L502.729054 556.586459c-0.659356-0.659356-1.728312-0.659356-2.397659 0L338.609327 718.318517c-11.708566 11.708566-30.680039 11.708566-42.388605 0l-0.039961-0.039961c-11.708566-11.708566-11.708566-30.680039 0-42.388605l161.732059-161.732058c0.659356-0.659356 0.659356-1.728312 0-2.397659L296.1408 350.008195c-11.708566-11.708566-11.708566-30.680039 0-42.388605l0.039961-0.039961c11.708566-11.708566 30.680039-11.708566 42.388605 0l161.772019 161.77202c0.659356 0.659356 1.728312 0.659356 2.397659 0L664.551024 307.539668c11.708566-11.708566 30.680039-11.708566 42.388605 0l0.039961 0.039961c11.708566 11.708566 11.708566 30.680039 0 42.388605L545.15762 511.770224c-0.659356 0.659356-0.659356 1.728312 0 2.397659L706.919649 675.939902c11.708566 11.708566 11.708566 30.680039 0 42.388605l-0.029971 0.029971z"
hc:IconElement.Geometry="{StaticResource About}"
hc:IconElement.Height="18"
hc:IconElement.Width="18"
HorizontalAlignment="Right"
/>
</hc:SideMenuItem.Icon>
</hc:SideMenuItem>
<hc:SideMenuItem Header="Work Items2">
<hc:SideMenuItem Header="显示设置"
Tag="Theme"
Selected="MemuClick">
<hc:SideMenuItem.Icon>
<Button Background="Transparent"
BorderThickness="0"
hc:IconElement.Geometry="M828.770654 148.714771C641.293737-20.89959 354.184117-19.590868 168.245698 152.630946c-212.062907 196.418185-212.062907 522.329912 0 718.748098 185.93842 172.221815 473.048039 173.520546 660.524956 3.916176 219.435707-198.536117 219.435707-528.054322 0-726.580449z m-121.880976 569.643707c-11.708566 11.708566-30.680039 11.708566-42.388605 0L502.729054 556.586459c-0.659356-0.659356-1.728312-0.659356-2.397659 0L338.609327 718.318517c-11.708566 11.708566-30.680039 11.708566-42.388605 0l-0.039961-0.039961c-11.708566-11.708566-11.708566-30.680039 0-42.388605l161.732059-161.732058c0.659356-0.659356 0.659356-1.728312 0-2.397659L296.1408 350.008195c-11.708566-11.708566-11.708566-30.680039 0-42.388605l0.039961-0.039961c11.708566-11.708566 30.680039-11.708566 42.388605 0l161.772019 161.77202c0.659356 0.659356 1.728312 0.659356 2.397659 0L664.551024 307.539668c11.708566-11.708566 30.680039-11.708566 42.388605 0l0.039961 0.039961c11.708566 11.708566 11.708566 30.680039 0 42.388605L545.15762 511.770224c-0.659356 0.659356-0.659356 1.728312 0 2.397659L706.919649 675.939902c11.708566 11.708566 11.708566 30.680039 0 42.388605l-0.029971 0.029971z"
hc:IconElement.Geometry="{StaticResource Pannel}"
hc:IconElement.Height="18"
hc:IconElement.Width="18"
HorizontalAlignment="Right"
/>
</hc:SideMenuItem.Icon>
</hc:SideMenuItem>
<hc:SideMenuItem Header="动作"
Tag="Motion"
Selected="MemuClick">
<hc:SideMenuItem.Icon>
<Button Background="Transparent"
BorderThickness="0"
hc:IconElement.Geometry="{StaticResource Motion}"
hc:IconElement.Height="18"
hc:IconElement.Width="18"
HorizontalAlignment="Right"
@@ -62,7 +102,7 @@
</hc:Card>
</hc:ScrollViewer>
<Button Width="22" Height="22" Click="Close_Button_Click" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" Grid.Column="1"/>
<Button Width="22" Height="22" Click="Close_Button_Click" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,10,10,0" Grid.Column="1"/>
</Grid>
</Border>

View File

@@ -15,11 +15,15 @@ namespace GeekDesk.Control
/// </summary>
public partial class ConfigWindow
{
private static AboutControl about = new AboutControl();
private static ThemeControl theme = new ThemeControl();
private static MotionControl motion = new MotionControl();
public ConfigWindow(AppConfig appConfig)
{
InitializeComponent();
this.DataContext = appConfig;
RightCard.Content = new SettingControl();
RightCard.Content = about;
this.Topmost = true;
}
@@ -47,5 +51,21 @@ namespace GeekDesk.Control
this.Close();
}
private void MemuClick(object sender, RoutedEventArgs e)
{
SideMenuItem smi = sender as SideMenuItem;
switch (smi.Tag.ToString())
{
case "Motion":
RightCard.Content = motion;
break;
case "Theme":
RightCard.Content = theme;
break;
default:
RightCard.Content = about;
break;
}
}
}
}

View File

@@ -0,0 +1,17 @@
<UserControl x:Class="GeekDesk.Control.UserControls.AboutControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:GeekDesk.Control.UserControls"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Background="AliceBlue"
d:DesignHeight="400" d:DesignWidth="500">
<hc:SimplePanel Margin="20">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
<Image Source="/Resource/Image/Ico.png" Width="250" Height="250"/>
<TextBlock Text="这是个人开发的程序,所有人可任意修改和免费试用(商用请联系作者)"/>
</StackPanel>
</hc:SimplePanel>
</UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace GeekDesk.Control.UserControls
{
/// <summary>
/// AboutControl.xaml 的交互逻辑
/// </summary>
public partial class AboutControl : UserControl
{
public AboutControl()
{
InitializeComponent();
}
}
}

View File

@@ -12,7 +12,7 @@
<UserControl.Resources>
<!--左侧栏样式动画-->
<Style x:Key="menuStyle" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItemBaseStyle}">
<Style x:Key="MenuStyle" TargetType="ListBoxItem" BasedOn="{StaticResource ListBoxItemBaseStyle}">
<Setter Property="FontSize" Value="15"/>
<Setter Property="Margin" Value="0,0,0,1"/>
<Setter Property="Background">
@@ -88,7 +88,7 @@
</ListBox.Resources>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource menuStyle}">
<Style TargetType="ListBoxItem" BasedOn="{StaticResource MenuStyle}">
<Setter Property="ContextMenu" Value="{StaticResource menuDialog}"/>
</Style>
</ListBox.ItemContainerStyle>

View File

@@ -0,0 +1,62 @@
<UserControl x:Class="GeekDesk.Control.UserControls.MotionControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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:local="clr-namespace:GeekDesk.Control.UserControls"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Background="AliceBlue"
d:DesignHeight="300" d:DesignWidth="450">
<UserControl.Resources>
<cvt:HideTypeConvert x:Key="HideTypeConvert"/>
</UserControl.Resources>
<hc:SimplePanel Margin="20">
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,0,10" Grid.ColumnSpan="4">
<TextBlock Text="面板动作设置" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="30,26.394,0,-16.394" Grid.ColumnSpan="4">
<CheckBox x:Name="IconIsAdmin" Content="启动时显示主面板" IsChecked="{Binding StartedShowPanel}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="30,50,0,-102.337" Grid.ColumnSpan="4">
<CheckBox Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}" Unchecked="CheckBox_Unchecked">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</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>
<hc:UniformSpacingPanel Spacing="10" Margin="10,115,20,-102.337" 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}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="运行项目后"
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=2}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="手动关闭"
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>
<hc:UniformSpacingPanel Spacing="10" Margin="30,193,0,-180.337" Grid.ColumnSpan="4">
<TextBlock Text="当前热键:"/>
</hc:UniformSpacingPanel>
</hc:SimplePanel>
</UserControl>

View File

@@ -0,0 +1,38 @@
using GeekDesk.Util;
using GeekDesk.ViewModel;
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace GeekDesk.Control.UserControls
{
/// <summary>
/// 动作设置
/// </summary>
public partial class MotionControl : UserControl
{
public MotionControl()
{
InitializeComponent();
}
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
{
}
}
}

View File

@@ -1,134 +0,0 @@
<UserControl x:Class="GeekDesk.Control.UserControls.SettingControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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:local="clr-namespace:GeekDesk.Control.UserControls"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Background="AliceBlue"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<cvt:HideTypeConvert x:Key="HideTypeConvert"/>
</UserControl.Resources>
<hc:SimplePanel Margin="10">
<hc:SimplePanel.Background>
<SolidColorBrush Opacity="0.9"/>
</hc:SimplePanel.Background>
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,0,10" Grid.ColumnSpan="4">
<TextBlock Text="主面板设置" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" Margin="30,22,450,119" LineStroke="Black" Grid.ColumnSpan="4"/>
<hc:UniformSpacingPanel Spacing="10" Margin="30,26.394,0,-16.394" Grid.ColumnSpan="4">
<CheckBox x:Name="IconIsAdmin" Content="启动时显示主面板" IsChecked="{Binding StartedShowPanel}">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="30,50,0,-102.337" Grid.ColumnSpan="4">
<CheckBox Content="显示时追随鼠标位置" IsChecked="{Binding FollowMouse}" Unchecked="CheckBox_Unchecked">
<CheckBox.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FF9EA3A6"/>
</LinearGradientBrush>
</CheckBox.Background>
</CheckBox>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="30,89.49,-30,-79.49" Grid.ColumnSpan="4">
<TextBlock Text="面板关闭方式" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" Margin="30,109,450,26.208" LineStroke="Black" Grid.ColumnSpan="4"/>
<hc:UniformSpacingPanel Spacing="10" Margin="40,115,-10,-102.337" 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}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="运行项目后"
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=2}"/>
<RadioButton Margin="10,0,0,0" Background="{DynamicResource SecondaryRegionBrush}"
Style="{StaticResource RadioButtonIcon}" Content="手动关闭"
IsChecked="{Binding AppHideType, Mode=TwoWay, Converter={StaticResource HideTypeConvert}, ConverterParameter=3}"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="30,160.5,-30,-150.5" Grid.ColumnSpan="4">
<TextBlock Text="背景图片" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="40,183,-40,-173" Grid.ColumnSpan="4">
<TextBlock Text="图片路径:" VerticalAlignment="Center"/>
<TextBlock Text="{Binding BacImgName}" Width="200"
VerticalAlignment="Center"
hc:Poptip.HitMode="None"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
hc:Poptip.Content="{Binding BacImgName}"
hc:Poptip.Placement="TopLeft"
/>
<Button Content="修改" Click="BGButton_Click"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" Margin="30,22,450,119" LineStroke="Black" Grid.ColumnSpan="4"/>
<hc:Divider LineStrokeDashArray="3,3" Margin="10,217.235,-10,-66.235" LineStroke="Black" Grid.ColumnSpan="4"/>
<hc:UniformSpacingPanel Spacing="10" Margin="30,240,-30,-230" Grid.ColumnSpan="4">
<TextBlock Text="托盘不透明度" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="40,267,-40,-257" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding CardOpacity}"
Maximum="100"
Margin="0,0,-313.5,7.5"
>
<hc:PreviewSlider.PreviewContent>
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="30,298.813,-30,-288.813" Grid.ColumnSpan="4">
<TextBlock Text="背景图片不透明度" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="40,330,-40,-320" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding BgOpacity}"
Maximum="100"
Margin="0,0,-313.5,7.5"
>
<hc:PreviewSlider.PreviewContent>
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="30,370.813,-30,-360.813" Grid.ColumnSpan="4">
<TextBlock Text="主面板不透明度" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="40,399,-40,-389" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding PannelOpacity}"
Minimum="50"
Maximum="100"
Margin="0,0,-313.5,7.5"
>
<hc:PreviewSlider.PreviewContent>
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="30,429.313,-30,-419.313" Grid.ColumnSpan="4">
<TextBlock Text="主面板圆角大小" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="40,463.5,-40,-453.5" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding PannelCornerRadius}"
Maximum="25"
Margin="0,0,-313.5,7.5"
>
<hc:PreviewSlider.PreviewContent>
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
</hc:SimplePanel>
</UserControl>

View File

@@ -0,0 +1,88 @@
<UserControl x:Class="GeekDesk.Control.UserControls.ThemeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:GeekDesk.Control.UserControls"
xmlns:hc="https://handyorg.github.io/handycontrol"
mc:Ignorable="d"
Background="AliceBlue"
d:DesignHeight="350" d:DesignWidth="450">
<hc:SimplePanel Margin="20">
<hc:UniformSpacingPanel Spacing="10" Margin="0,0,-40,-12" Grid.ColumnSpan="4">
<TextBlock Text="背景图片" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="19,20,-59,-31.5" Grid.ColumnSpan="4">
<TextBlock Text="图片路径:" VerticalAlignment="Center"/>
<TextBlock Text="{Binding BacImgName}" Width="200"
VerticalAlignment="Center"
hc:Poptip.HitMode="None"
hc:Poptip.IsOpen="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}"
hc:Poptip.Content="{Binding BacImgName}"
hc:Poptip.Placement="TopLeft"
/>
<Button Content="修改" Click="BGButton_Click"/>
</hc:UniformSpacingPanel>
<hc:Divider LineStrokeDashArray="3,3" Margin="0,60,0,66" LineStroke="Black" Grid.ColumnSpan="4"/>
<hc:UniformSpacingPanel Spacing="10" Margin="0,80,-40,-89.5" Grid.ColumnSpan="4">
<TextBlock Text="托盘不透明度" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,110,-40,-122" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding CardOpacity}"
Maximum="100"
Margin="0,-12,-313.5,19.5"
>
<hc:PreviewSlider.PreviewContent>
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,135,-40,-161.626" Grid.ColumnSpan="4">
<TextBlock Text="背景图片不透明度" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,155,-40,-183" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding BgOpacity}"
Maximum="100"
Margin="0,0,-313.5,7.5"
>
<hc:PreviewSlider.PreviewContent>
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,195,-40,-208.813" Grid.ColumnSpan="4">
<TextBlock Text="主面板不透明度" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,215,-40,-241" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding PannelOpacity}"
Minimum="50"
Maximum="100"
Margin="0,0,-313.5,7.5"
>
<hc:PreviewSlider.PreviewContent>
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,245,-40,-279.313" Grid.ColumnSpan="4">
<TextBlock Text="主面板圆角大小" VerticalAlignment="Center"/>
</hc:UniformSpacingPanel>
<hc:UniformSpacingPanel Spacing="10" Margin="0,265,-40,-321" Grid.ColumnSpan="4">
<hc:PreviewSlider Value="{Binding PannelCornerRadius}"
Maximum="25"
Margin="0,0,-313.5,7.5"
>
<hc:PreviewSlider.PreviewContent>
<Label Style="{StaticResource LabelPrimary}" Content="{Binding Path=(hc:PreviewSlider.PreviewPosition),RelativeSource={RelativeSource Self}}" ContentStringFormat="#0"/>
</hc:PreviewSlider.PreviewContent>
</hc:PreviewSlider>
</hc:UniformSpacingPanel>
</hc:SimplePanel>
</UserControl>

View File

@@ -19,20 +19,15 @@ using System.Windows.Shapes;
namespace GeekDesk.Control.UserControls
{
/// <summary>
/// SettingControl.xaml 的交互逻辑
/// MotionControl.xaml 的交互逻辑
/// </summary>
public partial class SettingControl : UserControl
public partial class ThemeControl : System.Windows.Controls.UserControl
{
public SettingControl()
public ThemeControl()
{
InitializeComponent();
}
private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
{
}
/// <summary>
/// 修改背景图片
/// </summary>
@@ -54,7 +49,8 @@ namespace GeekDesk.Control.UserControls
appConfig.BitmapImage = ImageUtil.GetBitmapImageByFile(ofd.FileName);
appConfig.BacImgName = ofd.FileName;
}
} catch (Exception)
}
catch (Exception)
{
HandyControl.Controls.Growl.WarningGlobal("修改背景失败,已重置为默认背景!");
}

View File

@@ -107,14 +107,20 @@
<Compile Include="Control\IconInfoDialog.xaml.cs">
<DependentUpon>IconInfoDialog.xaml</DependentUpon>
</Compile>
<Compile Include="Control\UserControls\AboutControl.xaml.cs">
<DependentUpon>AboutControl.xaml</DependentUpon>
</Compile>
<Compile Include="Control\UserControls\LeftCardControl.xaml.cs">
<DependentUpon>LeftCardControl.xaml</DependentUpon>
</Compile>
<Compile Include="Control\UserControls\ThemeControl.xaml.cs">
<DependentUpon>ThemeControl.xaml</DependentUpon>
</Compile>
<Compile Include="Control\UserControls\RightCardControl.xaml.cs">
<DependentUpon>RightCardControl.xaml</DependentUpon>
</Compile>
<Compile Include="Control\UserControls\SettingControl.xaml.cs">
<DependentUpon>SettingControl.xaml</DependentUpon>
<Compile Include="Control\UserControls\MotionControl.xaml.cs">
<DependentUpon>MotionControl.xaml</DependentUpon>
</Compile>
<Compile Include="Converts\DoubleToGridLength.cs" />
<Compile Include="Converts\IntToCornerRadius.cs" />
@@ -149,15 +155,23 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Control\UserControls\AboutControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Control\UserControls\LeftCardControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Control\UserControls\ThemeControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Control\UserControls\RightCardControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Control\UserControls\SettingControl.xaml">
<Page Include="Control\UserControls\MotionControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@@ -173,7 +187,7 @@
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="Resource\Dictionary\GemetryDictionary.xaml">
<Page Include="Resource\Dictionary\Geometry.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>

View File

@@ -27,8 +27,8 @@ namespace GeekDesk
public static AppData appData = CommonCode.GetAppDataByFile();
public MainWindow()
{
InitializeComponent();
LoadData();
InitializeComponent();
this.Topmost = true;
this.Loaded += Window_Loaded;
this.SizeChanged += MainWindow_Resize;
@@ -114,12 +114,6 @@ namespace GeekDesk
/// <summary>
/// 关闭按钮单击事件
/// </summary>
@@ -132,10 +126,6 @@ namespace GeekDesk
///// <summary>
///// 左侧栏宽度改变 持久化
///// </summary>

View File

@@ -1,11 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GeekDesk.Resource.Xaml">
<Geometry x:Key="ODDataGeometry">
M890.368 334.336c9.216 13.312 18.432 26.624 27.648 40.448 0.512 0 0.512 0.512 1.024 0.512l32.256-52.224c16.896-25.088 35.328-45.056 45.568-78.336 19.456-64.512-26.624-112.128-87.04-110.592-4.096 0.512-8.704 1.536-12.8 2.048-14.848 4.096-29.696 13.312-37.888 24.064-7.168 8.704-13.824 17.92-18.432 29.184-11.264 28.16-2.56 61.44 9.728 80.896 12.8 21.504 26.624 43.008 39.936 64zM881.152 209.92c5.632-17.92 17.408-21.504 34.304-28.16 53.248-1.024 54.272 74.752 5.12 81.92-25.088 3.584-47.616-28.16-39.424-53.76zM938.496 631.808c-46.592-30.72-93.696-60.928-140.288-91.648-15.872-10.752-32.256-22.016-48.128-32.768l-95.232-52.224c-16.896-9.728-36.864-18.432-50.176-31.744-0.512 0-0.512-0.512-1.024-0.512 63.488-13.312 129.536-13.824 196.096-25.088 34.304-4.096 68.096-7.68 102.4-11.776v-0.512c-5.12-7.168-19.968-27.136-27.648-30.72-8.704 0.512-17.408 1.536-25.6 2.048-30.72 2.048-61.952 3.584-92.672 5.632-24.064 3.584-48.64 0.512-74.24 4.608-71.68 6.656-143.872 13.312-215.552 19.456 32.256 25.088 65.024 50.176 97.28 74.752 34.816 23.04 72.192 41.472 105.984 65.536 43.008 33.28 86.016 66.56 128.512 100.352 0.512 0.512 0.512 1.024 1.024 1.536-103.424 6.656-206.848 13.312-309.76 19.456-20.992 1.024-41.984 2.048-62.464 2.56-25.6 4.096-49.152 5.12-72.704 9.728-11.264 1.536-22.528 3.584-34.304 5.12l-101.376 170.496c-0.512 0.512-0.512 1.024-1.024 1.536 114.688-25.088 233.472-44.032 349.696-70.144l188.928-33.792c89.088-15.36 178.688-30.72 267.776-46.08v-0.512c-28.672-17.92-56.832-36.864-85.504-55.296zM270.848 678.912c33.792-47.104 65.536-84.48 85.504-147.968 44.544-141.312-45.568-257.024-183.296-254.464-10.752 4.096-26.624 3.072-37.376 6.144-32.256 9.728-62.976 29.184-81.92 52.736-16.384 20.48-31.232 40.96-41.984 67.584C-12.8 465.92 5.12 532.48 32.768 577.536c31.744 51.712 64 102.4 98.304 151.552 18.432 27.136 36.352 54.272 54.784 80.896 0.512 0.512 1.024 0.512 1.536 1.024 11.264-18.432 22.528-36.864 34.304-55.296 16.384-26.112 31.744-52.224 49.152-76.8z m-166.912-89.6V387.584h68.096c19.968 0 35.84 1.536 48.128 4.096 12.288 3.072 23.552 7.68 33.28 14.336 14.336 9.728 25.6 21.504 33.792 36.352s12.288 30.208 12.288 46.592c0 15.872-3.072 30.208-9.216 44.032-6.144 13.312-15.36 25.088-26.624 35.328-8.704 7.168-18.432 12.288-29.696 15.872s-24.064 5.632-36.864 5.632l-93.184-0.512z
M223.232 433.664c-10.24-12.8-24.576-19.456-43.008-19.456h-19.456v147.456h19.456c18.432 0 33.28-6.656 43.008-19.456s15.36-31.232 15.36-54.784c0-22.528-5.12-40.96-15.36-53.76z
</Geometry>
</ResourceDictionary>

View File

@@ -0,0 +1,21 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:GeekDesk.Resource.Dictionary">
<Geometry x:Key="About">
M512 992C246.912 992 32 777.088 32 512 32 246.912 246.912 32 512 32c265.088 0 480 214.912 480 480 0 265.088-214.912 480-480 480z m-59.072-512v236.32a54.144 54.144 0 1 0 108.288 0V480a54.144 54.144 0 1 0-108.288 0z m53.76-226.464c-14.72 0-27.232 4.544-37.568 15.136-11.04 9.856-16.192 22.72-16.192 38.656 0 15.136 5.152 28 16.192 38.624 10.336 10.592 22.848 15.904 37.6 15.904a57.6 57.6 0 0 0 39.04-15.168c10.304-10.592 15.456-23.456 15.456-39.36s-5.12-28.8-15.456-38.656c-10.304-10.56-23.584-15.136-39.04-15.136z
</Geometry>
<Geometry x:Key="Pannel">
M106.666667 106.666667m21.333333 0l128 0q21.333333 0 21.333333 21.333333l0 768q0 21.333333-21.333333 21.333333l-128 0q-21.333333 0-21.333333-21.333333l0-768q0-21.333333 21.333333-21.333333Z
M341.333333 106.666667m21.333334 0l533.333333 0q21.333333 0 21.333333 21.333333l0 170.666667q0 21.333333-21.333333 21.333333l-533.333333 0q-21.333333 0-21.333334-21.333333l0-170.666667q0-21.333333 21.333334-21.333333Z
M341.333333 384m21.333334 0l533.333333 0q21.333333 0 21.333333 21.333333l0 490.666667q0 21.333333-21.333333 21.333333l-533.333333 0q-21.333333 0-21.333334-21.333333l0-490.666667q0-21.333333 21.333334-21.333333Z
</Geometry>
<Geometry x:Key="Motion">
M604.337231 269.666462a33.595077 33.595077 0 0 1-33.634462-33.595077 140.366769 140.366769 0 0 0-140.169846-140.209231 140.366769 140.366769 0 0 0-140.209231 140.209231 33.595077 33.595077 0 0 1-67.150769 0A207.596308 207.596308 0 0 1 430.532923 28.711385a207.596308 207.596308 0 0 1 207.399385 207.36 33.713231 33.713231 0 0 1-33.595077 33.595077z m-287.586462 259.150769V283.608615A114.569846 114.569846 0 0 1 431.241846 169.117538 114.609231 114.609231 0 0 1 545.693538 283.569231v46.158769a34.067692 34.067692 0 0 1 5.435077-0.393846c37.336615 0 70.380308 18.668308 90.19077 47.261538a109.764923 109.764923 0 0 1 119.414153 41.314462c7.758769-1.654154 15.675077-2.520615 23.709539-2.520616h7.207385a113.821538 113.821538 0 0 1 113.703384 113.664v131.15077a29.577846 29.577846 0 0 1 0.196923 3.820307v67.741539c0 153.521231-67.702154 250.052923-190.621538 271.753846-38.4 6.616615-74.161231 10.003692-107.52 10.003692-101.454769 0-181.011692-31.507692-245.681231-96.17723L154.249846 710.025846a122.052923 122.052923 0 0 1 0-172.347077 122.092308 122.092308 0 0 1 162.500923-8.861538z m386.520616 408.457846c89.6-15.753846 135.089231-84.873846 135.08923-205.508923v-19.337846a34.067692 34.067692 0 0 1-0.078769-2.756923v-180.657231c0-25.718154-20.873846-46.473846-46.473846-46.473846h-7.246769c-1.102769 0-2.166154 0-3.308308 0.118154v110.788923a33.634462 33.634462 0 1 1-67.268923-0.118154v-111.773539a42.023385 42.023385 0 0 0-53.169231-40.487384v115.672615a33.595077 33.595077 0 0 1-67.190154 0v-117.76c0-23.433846-19.062154-42.456615-42.496-42.456615a33.792 33.792 0 0 1-5.435077-0.472616v126.267077a33.595077 33.595077 0 1 1-67.229538 0V283.608615a47.379692 47.379692 0 0 0-94.759385 0v321.457231a33.555692 33.555692 0 0 1-57.107692 27.569231l-47.497846-47.458462a54.744615 54.744615 0 0 0-77.390769 77.351385l207.478154 207.399385c69.080615 69.001846 162.500923 90.348308 294.084923 67.347692z
</Geometry>
</ResourceDictionary>