Skip to content

Commit

Permalink
增加固定按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
GiantappMan committed Aug 10, 2022
1 parent 915619e commit 29ad419
Show file tree
Hide file tree
Showing 10 changed files with 279 additions and 108 deletions.
1 change: 1 addition & 0 deletions src/EyeNurse/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ResourceDictionary>
<app_converters:InverseBooleanConveter x:Key="InverseBooleanConveter" />
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Eye Nurse 2;component/Styles/All.xaml" />
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
</ResourceDictionary.MergedDictionaries>
Expand Down
Binary file added src/EyeNurse/Assets/Img/TopMostChecked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/EyeNurse/Assets/Img/TopMostUnChecked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 9 additions & 8 deletions src/EyeNurse/Assets/Languages/en.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"app_name": "EyeNurse 2",
"about": "About",
"setting": "Setting",
"always_on_top": "Always on top",
"app_name": "EyeNurse 2",
"exit": "Exit",
"installNow": "Install now",
"installWebview2Tips": "This function requires Microsoft's latest webview2 runtime support. Please reopen this window after manual installation",
"pause": "Pause",
"resume": "Resume",
"reset": "Reset",
"resting": "Resting...",
"rest_now": "Rest now",
"installWebview2Tips": "This function requires Microsoft's latest webview2 runtime support. Please reopen this window after manual installation",
"installNow": "Install now",
"exit": "Exit"
}
"resting": "Resting...",
"resume": "Resume",
"setting": "Setting"
}
17 changes: 9 additions & 8 deletions src/EyeNurse/Assets/Languages/zh.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"app_name": "眼睛护士2",
"about": "关于",
"setting": "设置",
"always_on_top": "置于顶层",
"app_name": "眼睛护士2",
"exit": "退出",
"installNow": "立刻安装",
"installWebview2Tips": "本功能需要微软最新的webview2运行时支持,请手动安装后,重新打开本窗口",
"pause": "暂停",
"resume": "恢复",
"reset": "重置",
"resting": "休息中...",
"rest_now": "立刻休息",
"installWebview2Tips": "本功能需要微软最新的webview2运行时支持,请手动安装后,重新打开本窗口",
"installNow": "立刻安装",
"exit": "退出"
}
"resting": "休息中...",
"resume": "恢复",
"setting": "设置"
}
10 changes: 9 additions & 1 deletion src/EyeNurse/EyeNurse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<Version>2.0.4</Version>
<Version>2.0.5</Version>
<Company>Giantapp Studio</Company>
<Authors>Giantapp Studio</Authors>
<Description>https://eyenurse.giantapp.cn</Description>
Expand All @@ -17,6 +17,8 @@
<ItemGroup>
<None Remove="Assets\Img\logo.ico" />
<None Remove="Assets\Img\logo.png" />
<None Remove="Assets\Img\TopMostChecked.png" />
<None Remove="Assets\Img\TopMostUnChecked.png" />
<None Remove="Assets\Languages\en.json" />
<None Remove="Assets\Languages\zh.json" />
</ItemGroup>
Expand All @@ -28,6 +30,12 @@
<Content Include="Assets\Img\logo.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Img\TopMostChecked.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Img\TopMostUnChecked.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\Languages\en.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
5 changes: 5 additions & 0 deletions src/EyeNurse/Styles/All.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Eye Nurse 2;component/Styles/CheckBox.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
148 changes: 148 additions & 0 deletions src/EyeNurse/Styles/CheckBox.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="clr-namespace:HandyControl.Controls;assembly=HandyControl">
<!-- Control colors. -->
<Color x:Key="WindowColor">#FFE8EDF9</Color>
<Color x:Key="ContentAreaColorLight">#FFC5CBF9</Color>
<Color x:Key="ContentAreaColorDark">#FF7381F9</Color>

<Color x:Key="DisabledControlLightColor">#FFE8EDF9</Color>
<Color x:Key="DisabledControlDarkColor">#FFC5CBF9</Color>
<Color x:Key="DisabledForegroundColor">#FF888888</Color>

<Color x:Key="SelectedBackgroundColor">#FFC5CBF9</Color>
<Color x:Key="SelectedUnfocusedColor">#FFDDDDDD</Color>

<Color x:Key="ControlLightColor">White</Color>
<Color x:Key="ControlMediumColor">#FF7381F9</Color>
<Color x:Key="ControlDarkColor">#FF211AA9</Color>

<Color x:Key="ControlMouseOverColor">#FF3843C4</Color>
<Color x:Key="ControlPressedColor">#FF211AA9</Color>


<Color x:Key="GlyphColor">#FF444444</Color>
<Color x:Key="GlyphMouseOver">sc#1, 0.004391443, 0.002428215, 0.242281124</Color>

<!-- Border colors -->
<Color x:Key="BorderLightColor">#FFCCCCCC</Color>
<Color x:Key="BorderMediumColor">#FF888888</Color>
<Color x:Key="BorderDarkColor">#FF444444</Color>

<Color x:Key="PressedBorderLightColor">#FF888888</Color>
<Color x:Key="PressedBorderDarkColor">#FF444444</Color>

<Color x:Key="DisabledBorderLightColor">#FFAAAAAA</Color>
<Color x:Key="DisabledBorderDarkColor">#FF888888</Color>

<Color x:Key="DefaultBorderBrushDarkColor">Black</Color>

<!-- Control-specific resources. -->
<Color x:Key="HeaderTopColor">#FFC5CBF9</Color>
<Color x:Key="DatagridCurrentCellBorderColor">Black</Color>
<Color x:Key="SliderTrackDarkColor">#FFC5CBF9</Color>

<Color x:Key="NavButtonFrameColor">#FF3843C4</Color>

<LinearGradientBrush x:Key="MenuPopupBrush" StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0" Color="{DynamicResource ControlLightColor}" />
<GradientStop Offset="0.5" Color="{DynamicResource ControlMediumColor}" />
<GradientStop Offset="1" Color="{DynamicResource ControlLightColor}" />
</LinearGradientBrush>

<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill" StartPoint="0,0" EndPoint="1,0">
<LinearGradientBrush.GradientStops>
<GradientStopCollection>
<GradientStop Offset="0" Color="#000000FF" />
<GradientStop Offset="0.4" Color="#600000FF" />
<GradientStop Offset="0.6" Color="#600000FF" />
<GradientStop Offset="1" Color="#000000FF" />
</GradientStopCollection>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
<Style x:Key="TopMostCheckBox" TargetType="{x:Type CheckBox}">
<Setter Property="Width" Value="18" />
<Setter Property="Height" Value="18" />
<Setter Property="Margin" Value="0,0,1,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<BulletDecorator Background="Transparent">
<BulletDecorator.Bullet>
<Border
x:Name="Border"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="1"
CornerRadius="0">
<Grid>
<Image
x:Name="CheckMark"
Source="/Assets/Img/TopMostChecked.png"
Visibility="Collapsed" />
<Image
x:Name="UnCheckMark"
Source="/Assets/Img/TopMostUnChecked.png"
Visibility="Collapsed" />
<!--<Grid
x:Name="mask"
Background="Gray"
Opacity="0.5" />-->
</Grid>
</Border>
</BulletDecorator.Bullet>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation
Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
To="#FFFFFF"
Duration="0:0:0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ColorAnimation
Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
To="#FFFFFF"
Duration="0:0:0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled" />
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="UnCheckMark" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="InderminateMark" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</BulletDecorator>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
Loading

0 comments on commit 29ad419

Please sign in to comment.