-
Notifications
You must be signed in to change notification settings - Fork 0
/
tinyStyle.xaml
190 lines (189 loc) · 10.2 KB
/
tinyStyle.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type Button}" x:Key="AppleButtonStyle">
<Setter Property="Margin" Value="5" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="ApplePriButtonStyle">
<Setter Property="Background" Value="#F5798B" />
<!-- 粉色背景 -->
<Setter Property="Foreground" Value="White" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="Padding" Value="10,5" />
<Setter Property="Margin" Value="5" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="30">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FF69B4" />
<!-- 更深的粉色 -->
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#FF1493" />
<!-- 更深的粉色 -->
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="ToggleButton" x:Key="AppleToggleButtonStyle">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Grid Height="30" Width="60">
<!-- Background -->
<Border
Background="#E57373"
CornerRadius="15"
x:Name="BackgroundBorder" />
<!-- Thumb -->
<Ellipse
Height="26"
Margin="2"
Width="26"
x:Name="Thumb">
<Ellipse.Fill>
<LinearGradientBrush EndPoint="1,1" StartPoint="0,0">
<GradientStop Color="White" Offset="0.0" />
<GradientStop Color="#CCCCCC" Offset="1.0" />
</LinearGradientBrush>
</Ellipse.Fill>
<Ellipse.Effect>
<DropShadowEffect
BlurRadius="5"
Color="Black"
ShadowDepth="3" />
</Ellipse.Effect>
</Ellipse>
<!-- On/Off Text -->
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<ColorAnimation
Duration="0:0:0.2"
Storyboard.TargetName="BackgroundBorder"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="#F06292" />
<ThicknessAnimation
Duration="0:0:0.2"
Storyboard.TargetName="Thumb"
Storyboard.TargetProperty="Margin"
To="32,2,2,2" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked">
<Storyboard>
<ColorAnimation
Duration="0:0:0.2"
Storyboard.TargetName="BackgroundBorder"
Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
To="#E57373" />
<ThicknessAnimation
Duration="0:0:0.2"
Storyboard.TargetName="Thumb"
Storyboard.TargetProperty="Margin"
To="2,2,32,2" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ProgressBar}" x:Key="MacOSProgressBarStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ProgressBar}">
<Grid>
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10"
x:Name="PART_Track">
<Border.Effect>
<DropShadowEffect
BlurRadius="10"
Color="#FFE0E0E0"
Direction="0"
ShadowDepth="0" />
</Border.Effect>
</Border>
<Border
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10"
HorizontalAlignment="Left"
x:Name="PART_Indicator">
<Border.Background>
<LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="#FFFFB7DD" Offset="0" />
<GradientStop Color="#FFFF8CC6" Offset="1" />
</LinearGradientBrush>
</Border.Background>
</Border>
<Grid ClipToBounds="True" x:Name="PART_GlowGrid">
<Border
Background="White"
CornerRadius="10"
HorizontalAlignment="Left"
Margin="-25,0,0,0"
Opacity="0"
Width="50"
x:Name="PART_GlowIndicator">
<Border.Effect>
<BlurEffect Radius="10" />
</Border.Effect>
</Border>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsIndeterminate" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_GlowIndicator" Storyboard.TargetProperty="(UIElement.Opacity)">
<DiscreteDoubleKeyFrame KeyTime="0" Value="0" />
<DiscreteDoubleKeyFrame KeyTime="0:0:0.5" Value="1" />
<DiscreteDoubleKeyFrame KeyTime="0:0:2.5" Value="0" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_GlowIndicator" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
<DiscreteDoubleKeyFrame KeyTime="0" Value="-25" />
<DiscreteDoubleKeyFrame KeyTime="0:0:2.5" Value="325" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>