Skip to content

Commit 0a9236b

Browse files
committed
✨ Account Settings, Tab Style, Button Style
1 parent 2e0144a commit 0a9236b

8 files changed

+202
-61
lines changed

Biyori/Biyori.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@
244244
<SubType>Designer</SubType>
245245
<Generator>MSBuild:Compile</Generator>
246246
</Page>
247+
<Page Include="Lib\Styles\TabControl.styles.xaml">
248+
<SubType>Designer</SubType>
249+
<Generator>MSBuild:Compile</Generator>
250+
</Page>
247251
<Page Include="MainWindow.dictionary.xaml">
248252
<SubType>Designer</SubType>
249253
<Generator>MSBuild:Compile</Generator>

Biyori/Lib/Controls/CardControl.style.xaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
xmlns:local="clr-namespace:Biyori.Lib.Controls">
44

55
<Style TargetType="{x:Type local:CardControl}">
6+
<Setter Property="Focusable" Value="False"/>
67
<Setter Property="Template">
78
<Setter.Value>
89
<ControlTemplate TargetType="{x:Type local:CardControl}">
9-
<Grid ClipToBounds="False">
10-
<Border Padding="{TemplateBinding Padding}">
10+
<Grid ClipToBounds="False" Focusable="False">
11+
<Border Padding="{TemplateBinding Padding}" Focusable="False">
1112
<Border.Style>
1213

1314
<Style TargetType="Border">
15+
<Setter Property="Focusable" Value="False"/>
1416
<Setter Property="Padding" Value="10"/>
1517
<Setter Property="Background" Value="#ffffff" />
1618
<Setter Property="CornerRadius" Value="6"/>
@@ -23,8 +25,8 @@
2325
</Setter>
2426
</Style>
2527
</Border.Style>
26-
<Grid>
27-
<ContentControl Content="{TemplateBinding Content}"></ContentControl>
28+
<Grid Focusable="False">
29+
<ContentControl Focusable="False" Content="{TemplateBinding Content}"></ContentControl>
2830
</Grid>
2931
</Border>
3032
</Grid>

Biyori/Lib/Styles/App.styles.xaml

+11
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@
66
<Setter Property="FontStyle" Value="Italic" />
77
<Setter Property="FontSize" Value="12" />
88
</Style>
9+
<Style TargetType="Window">
10+
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
11+
<Setter Property="TextOptions.TextRenderingMode" Value="Aliased" />
12+
<Setter Property="TextOptions.TextHintingMode" Value="Auto" />
13+
</Style>
14+
<Style TargetType="Button">
15+
<Setter Property="TextOptions.TextFormattingMode" Value="Display" />
16+
<Setter Property="TextOptions.TextRenderingMode" Value="Aliased" />
17+
<Setter Property="TextOptions.TextHintingMode" Value="Auto" />
18+
</Style>
919
<ResourceDictionary.MergedDictionaries>
1020
<ResourceDictionary Source="pack://application:,,,/Lib/Styles/Buttons.styles.xaml" />
21+
<ResourceDictionary Source="pack://application:,,,/Lib/Styles/TabControl.styles.xaml" />
1122
<ResourceDictionary Source="pack://application:,,,/Lib/Controls/CardControl.style.xaml" />
1223
</ResourceDictionary.MergedDictionaries>
1324
</ResourceDictionary>

Biyori/Lib/Styles/Buttons.styles.xaml

+24-42
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,46 @@
88
<Setter Property="Padding" Value="8, 6" />
99
<!--<Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisual}" />-->
1010
<Setter Property="Background" Value="#fafafa"/>
11+
<Setter Property="BorderBrush" Value="#e0e0e0"/>
12+
<Setter Property="BorderThickness" Value="1"/>
13+
<Setter Property="ClipToBounds" Value="False"/>
1114
<Setter Property="Template">
1215
<Setter.Value>
1316
<ControlTemplate TargetType="Button">
1417
<ControlTemplate.Resources>
15-
16-
17-
<Storyboard x:Key="GlowOn">
18-
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
19-
Storyboard.TargetName="border"
20-
Storyboard.TargetProperty="(Effect).Opacity">
21-
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value=".8"/>
22-
</DoubleAnimationUsingKeyFrames>
23-
</Storyboard>
24-
<Storyboard x:Key="GlowOff">
25-
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
26-
Storyboard.TargetName="border"
27-
Storyboard.TargetProperty="(Effect).Opacity">
28-
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value=".4"/>
29-
</DoubleAnimationUsingKeyFrames>
30-
</Storyboard>
3118
<Storyboard x:Key="JellyClick">
3219
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
3320
Storyboard.TargetName="border"
3421
Storyboard.TargetProperty="(RenderTransform).ScaleX">
35-
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value=".925"/>
22+
<SplineDoubleKeyFrame KeyTime="0:0:0.1" Value=".9125"/>
3623
</DoubleAnimationUsingKeyFrames>
3724
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
3825
Storyboard.TargetName="border"
3926
Storyboard.TargetProperty="(RenderTransform).ScaleY">
40-
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value=".925"/>
27+
<SplineDoubleKeyFrame KeyTime="0:0:0.1" Value=".9125"/>
4128
</DoubleAnimationUsingKeyFrames>
4229
</Storyboard>
4330
<Storyboard x:Key="JellyClickOff">
4431
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
4532
Storyboard.TargetName="border"
4633
Storyboard.TargetProperty="(RenderTransform).ScaleX">
47-
<SplineDoubleKeyFrame KeyTime="0:0:0.15" Value="1"/>
34+
<EasingDoubleKeyFrame KeyTime="0:0:0.15" Value="1"/>
4835
</DoubleAnimationUsingKeyFrames>
4936
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
5037
Storyboard.TargetName="border"
5138
Storyboard.TargetProperty="(RenderTransform).ScaleY">
52-
<SplineDoubleKeyFrame KeyTime="0:0:0.15" Value="1"/>
39+
<EasingDoubleKeyFrame KeyTime="0:0:0.15" Value="1"/>
5340
</DoubleAnimationUsingKeyFrames>
5441
</Storyboard>
5542
</ControlTemplate.Resources>
56-
<Grid Margin="{TemplateBinding Margin}">
57-
<Border Name="border"
58-
BorderThickness="0"
59-
Margin="{TemplateBinding Margin}"
60-
Padding="{TemplateBinding Padding}"
61-
BorderBrush="DarkGray"
62-
CornerRadius="2"
63-
Background="{TemplateBinding Background}">
64-
<Border.Effect>
65-
<DropShadowEffect x:Name="shadow" RenderingBias="Quality" Direction="90" BlurRadius="4" ShadowDepth="0" Color="#000" Opacity=".4" />
66-
</Border.Effect>
43+
<Grid Margin="{TemplateBinding Margin}" UseLayoutRounding="True" SnapsToDevicePixels="True" ClipToBounds="False">
44+
<Border Name="border"
45+
UseLayoutRounding="True"
46+
BorderThickness="{TemplateBinding BorderThickness}"
47+
BorderBrush="{TemplateBinding BorderBrush}"
48+
CornerRadius="2"
49+
Padding="{TemplateBinding Padding}"
50+
Background="{TemplateBinding Background}">
6751
<Border.Resources>
6852
</Border.Resources>
6953
<Border.RenderTransformOrigin>
@@ -72,38 +56,36 @@
7256
<Border.RenderTransform>
7357
<ScaleTransform ScaleX="1" ScaleY="1" RenderOptions.BitmapScalingMode="NearestNeighbor" />
7458
</Border.RenderTransform>
75-
<Grid>
76-
<ContentPresenter HorizontalAlignment="Center"
59+
<ContentPresenter TextOptions.TextFormattingMode="Display" HorizontalAlignment="Center"
7760
VerticalAlignment="Center" Name="content"/>
78-
</Grid>
7961
</Border>
8062
</Grid>
8163
<ControlTemplate.Triggers>
8264
<Trigger Property="IsMouseOver" Value="True">
8365
<Setter Property="Background" Value="#fff" />
66+
<Setter Property="Cursor" Value="Hand" />
67+
</Trigger>
68+
<Trigger Property="IsPressed" Value="True">
8469
<Trigger.EnterActions>
85-
<BeginStoryboard Storyboard="{StaticResource GlowOn}" />
70+
<BeginStoryboard Storyboard="{StaticResource JellyClick}" />
8671
</Trigger.EnterActions>
8772
<Trigger.ExitActions>
88-
<BeginStoryboard Storyboard="{StaticResource GlowOff}" />
73+
<BeginStoryboard Storyboard="{StaticResource JellyClickOff}" />
8974
</Trigger.ExitActions>
9075
</Trigger>
91-
<Trigger Property="IsPressed" Value="True">
76+
<Trigger Property="IsDefaulted" Value="True">
9277
<Trigger.EnterActions>
93-
<BeginStoryboard Storyboard="{StaticResource GlowOn}" />
9478
<BeginStoryboard Storyboard="{StaticResource JellyClick}" />
9579
</Trigger.EnterActions>
9680
<Trigger.ExitActions>
97-
<BeginStoryboard Storyboard="{StaticResource GlowOff}" />
9881
<BeginStoryboard Storyboard="{StaticResource JellyClickOff}" />
9982
</Trigger.ExitActions>
10083
</Trigger>
101-
<Trigger Property="IsDefaulted" Value="True">
102-
</Trigger>
10384
<Trigger Property="IsFocused" Value="True">
10485
</Trigger>
10586
<Trigger Property="IsEnabled" Value="False">
106-
<Setter Property="Background" Value="#ddd" />
87+
<Setter Property="Background" Value="#ccc" />
88+
<Setter Property="BorderBrush" Value="#aaa" />
10789
</Trigger>
10890

10991
</ControlTemplate.Triggers>
+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:local="clr-namespace:Biyori.Lib.Styles">
4+
<SolidColorBrush x:Key="TabItemBorderColor" Color="#e8e8e8" />
5+
<SolidColorBrush x:Key="TabItemBackground" Color="#fafafa" />
6+
<SolidColorBrush x:Key="TabItemBackgroundSelected" Color="#fff" />
7+
<SolidColorBrush x:Key="TabItemBorderColorSelected" Color="#f0f0f0" />
8+
<Style TargetType="TabItem">
9+
<Setter Property="Template">
10+
<Setter.Value>
11+
<ControlTemplate TargetType="TabItem">
12+
<Border Name="Border" Background="{StaticResource TabItemBackground}" BorderThickness="1,1,1,0" BorderBrush="{StaticResource TabItemBorderColor}" CornerRadius="2,2,0,0" Margin="4,0">
13+
<ContentPresenter x:Name="ContentSite"
14+
VerticalAlignment="Center"
15+
HorizontalAlignment="Center"
16+
ContentSource="Header"
17+
Margin="10,2"/>
18+
</Border>
19+
<ControlTemplate.Triggers>
20+
<Trigger Property="IsSelected" Value="True">
21+
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource TabItemBorderColorSelected}" />
22+
<Setter TargetName="Border" Property="Background" Value="{StaticResource TabItemBackgroundSelected}" />
23+
</Trigger>
24+
<Trigger Property="IsSelected" Value="False">
25+
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource TabItemBorderColor}" />
26+
<Setter TargetName="Border" Property="Background" Value="{StaticResource TabItemBackground}" />
27+
</Trigger>
28+
</ControlTemplate.Triggers>
29+
</ControlTemplate>
30+
</Setter.Value>
31+
</Setter>
32+
</Style>
33+
<Style TargetType="TabControl">
34+
<Setter Property="BorderBrush" Value="{StaticResource TabItemBorderColor}" />
35+
<Setter Property="Background" Value="{StaticResource TabItemBackground}" />
36+
<Setter Property="Template">
37+
<Setter.Value>
38+
<ControlTemplate TargetType="{x:Type TabControl}">
39+
<DockPanel KeyboardNavigation.TabNavigation="Local" LastChildFill="True">
40+
<TabPanel DockPanel.Dock="{TemplateBinding TabStripPlacement}"
41+
Name="HeaderPanel"
42+
Grid.Row="0"
43+
Panel.ZIndex="1"
44+
Margin="0,0,8,0"
45+
IsItemsHost="True"
46+
KeyboardNavigation.TabIndex="1"
47+
Background="Transparent" />
48+
<Border
49+
Name="Border"
50+
Background="{TemplateBinding Background}"
51+
BorderBrush="{TemplateBinding BorderBrush}"
52+
BorderThickness="1"
53+
CornerRadius="2" >
54+
<ContentPresenter
55+
ContentSource="SelectedContent" />
56+
</Border>
57+
</DockPanel>
58+
<ControlTemplate.Triggers>
59+
<Trigger Property="IsEnabled" Value="False">
60+
<Setter Property="Foreground" Value="Black" />
61+
<Setter TargetName="Border" Property="BorderBrush" Value="DarkGray" />
62+
</Trigger>
63+
</ControlTemplate.Triggers>
64+
</ControlTemplate>
65+
</Setter.Value>
66+
</Setter>
67+
</Style>
68+
</ResourceDictionary>

0 commit comments

Comments
 (0)