Repository navigation
Expand file tree
/
Copy pathApp.xaml
More file actions
267 lines (262 loc) · 14.6 KB
/
Copy pathApp.xaml
File metadata and controls
267 lines (262 loc) · 14.6 KB
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<Application
x:Class="ProxiLock.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ProxiLock">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.SettingsControls/SettingsExpander/SettingsExpander.xaml" />
</ResourceDictionary.MergedDictionaries>
<!--
The settings shell paints a few surfaces itself (pane header, navigation
selection, status pill) instead of relying on system brushes, so those values
have to exist for both themes. Without these the dark literals collided with
theme-aware foregrounds and the text became unreadable in light mode.
-->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="PaneSurfaceBrush" Color="#232830" />
<!-- Muted selection fill for the settings navigation instead of the default
accent wash, so it does not read as a dark-on-dark patch in light mode. -->
<SolidColorBrush x:Key="NavigationViewItemBackgroundSelected" Color="#39383B" />
<SolidColorBrush x:Key="StatusRunningBackgroundBrush" Color="#1E3A32" />
<SolidColorBrush x:Key="StatusRunningForegroundBrush" Color="#6EE7B7" />
<SolidColorBrush x:Key="StatusLockedBackgroundBrush" Color="#3E2523" />
<SolidColorBrush x:Key="StatusLockedForegroundBrush" Color="#FF9A8A" />
<SolidColorBrush x:Key="SaveSucceededForegroundBrush" Color="#6EE7B7" />
<SolidColorBrush x:Key="SaveFailedForegroundBrush" Color="#FF9A8A" />
<SolidColorBrush x:Key="MenuSurfaceBrush" Color="#25262B" />
<SolidColorBrush x:Key="MenuBorderBrush" Color="#45464D" />
<SolidColorBrush x:Key="MenuItemHoverBrush" Color="#393A42" />
<SolidColorBrush x:Key="MenuItemPressedBrush" Color="#303139" />
<SolidColorBrush x:Key="MenuForegroundBrush" Color="#F5F5F7" />
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="PaneSurfaceBrush" Color="#F3F4F6" />
<SolidColorBrush x:Key="NavigationViewItemBackgroundSelected" Color="#E4E6EA" />
<SolidColorBrush x:Key="StatusRunningBackgroundBrush" Color="#E4F5EE" />
<SolidColorBrush x:Key="StatusRunningForegroundBrush" Color="#0F6B52" />
<SolidColorBrush x:Key="StatusLockedBackgroundBrush" Color="#FCE9E7" />
<SolidColorBrush x:Key="StatusLockedForegroundBrush" Color="#B3261E" />
<SolidColorBrush x:Key="SaveSucceededForegroundBrush" Color="#0F6B52" />
<SolidColorBrush x:Key="SaveFailedForegroundBrush" Color="#B3261E" />
<SolidColorBrush x:Key="MenuSurfaceBrush" Color="#FBFBFD" />
<SolidColorBrush x:Key="MenuBorderBrush" Color="#D8DAE0" />
<SolidColorBrush x:Key="MenuItemHoverBrush" Color="#ECEEF2" />
<SolidColorBrush x:Key="MenuItemPressedBrush" Color="#DFE2E8" />
<SolidColorBrush x:Key="MenuForegroundBrush" Color="#1B1C1F" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<local:BoolToVisibilityConverter x:Key="BoolToVisibility" />
<!-- BetterLyrics-style settings layout primitives. -->
<x:Double x:Key="SettingsCardSpacing">4</x:Double>
<Style x:Key="SettingsScrollViewerStyle" TargetType="ScrollViewer">
<Setter Property="Padding" Value="36,40,36,52" />
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
</Style>
<Style x:Key="SettingsGridStyle" TargetType="Grid">
<Setter Property="Padding" Value="0,0,0,36" />
</Style>
<!--
One title/description pair per page, matching the navigation labels. Every page
used to open differently (only "自动锁定" had a title, the rest led with a small
section header), which made the hierarchy collapse as you moved between pages.
-->
<Style x:Key="SettingsPageTitleTextBlockStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="28" />
<Setter Property="FontWeight" Value="SemiBold" />
<Setter Property="Margin" Value="0,0,0,4" />
<!-- Large text needs negative tracking; -0.02em reads tighter without crowding. -->
<Setter Property="CharacterSpacing" Value="-20" />
</Style>
<Style x:Key="SettingsPageDescriptionTextBlockStyle" TargetType="TextBlock">
<Setter Property="Margin" Value="0,0,0,18" />
<Setter Property="Foreground" Value="{ThemeResource TextFillColorSecondaryBrush}" />
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
<Style x:Key="SettingsPaneToggleButtonStyle" TargetType="Button">
<Setter Property="Width" Value="35" />
<Setter Property="Height" Value="35" />
<Setter Property="MinWidth" Value="35" />
<Setter Property="MinHeight" Value="35" />
<Setter Property="Margin" Value="16,12,0,10" />
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid
x:Name="LayoutRoot"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Background="{TemplateBinding Background}">
<FontIcon
FontFamily="{StaticResource SegoeFluentIcons}"
FontSize="16"
Glyph=""
HorizontalAlignment="Left"
Margin="24,14,0,0"
VerticalAlignment="Center"
Foreground="{TemplateBinding Foreground}" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuItemHoverBrush}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuItemPressedBrush}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="LayoutRoot.Opacity" Value="0.45" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Thickness x:Key="BetterLyricsMenuItemMargin">2,2,2,2</Thickness>
<Thickness x:Key="BetterLyricsMenuItemPadding">10,6,10,6</Thickness>
<Style x:Key="DefaultMenuFlyoutPresenterStyle" TargetType="MenuFlyoutPresenter">
<Setter Property="Background" Value="{ThemeResource MenuSurfaceBrush}" />
<Setter Property="BorderBrush" Value="{ThemeResource MenuBorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="8" />
<Setter Property="Padding" Value="4" />
<Setter Property="MinWidth" Value="220" />
</Style>
<Style x:Key="DefaultMenuFlyoutItemStyle" TargetType="MenuFlyoutItem">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="{ThemeResource MenuForegroundBrush}" />
<Setter Property="Padding" Value="{StaticResource BetterLyricsMenuItemPadding}" />
<Setter Property="FontSize" Value="15" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="CornerRadius" Value="6" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="MenuFlyoutItem">
<Grid
x:Name="LayoutRoot"
Margin="{StaticResource BetterLyricsMenuItemMargin}"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Grid x:Name="InnerContentRoot" RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="MenuItemScale" ScaleX="1" ScaleY="1" />
<TranslateTransform x:Name="MenuItemTranslate" X="0" Y="0" />
</TransformGroup>
</Grid.RenderTransform>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Viewbox
x:Name="IconRoot"
Width="18"
Height="18"
Margin="0,0,10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center">
<ContentPresenter
x:Name="IconContent"
Content="{TemplateBinding Icon}"
Foreground="{TemplateBinding Foreground}" />
</Viewbox>
<TextBlock
x:Name="TextBlock"
Grid.Column="1"
VerticalAlignment="Center"
Foreground="{TemplateBinding Foreground}"
FontSize="{TemplateBinding FontSize}"
Text="{TemplateBinding Text}"
TextTrimming="CharacterEllipsis" />
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="MenuItemTranslate"
Storyboard.TargetProperty="X"
To="0"
Duration="0:0:0.14">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<!-- Without this the item stays shrunk at 0.97 after any click,
because only the Pressed state animated the scale. -->
<DoubleAnimation Storyboard.TargetName="MenuItemScale" Storyboard.TargetProperty="ScaleX" To="1" Duration="0:0:0.14" />
<DoubleAnimation Storyboard.TargetName="MenuItemScale" Storyboard.TargetProperty="ScaleY" To="1" Duration="0:0:0.14" />
</Storyboard>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuItemHoverBrush}" />
<Setter Target="TextBlock.Foreground" Value="{ThemeResource MenuForegroundBrush}" />
<Setter Target="IconContent.Foreground" Value="{ThemeResource MenuForegroundBrush}" />
</VisualState.Setters>
<Storyboard>
<!-- Matches the settings navigation nudge (2px / 140ms) so the two
menus share one hover feel instead of drifting apart. -->
<DoubleAnimation
Storyboard.TargetName="MenuItemTranslate"
Storyboard.TargetProperty="X"
To="2"
Duration="0:0:0.14">
<DoubleAnimation.EasingFunction>
<CubicEase EasingMode="EaseOut" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<VisualState.Setters>
<Setter Target="LayoutRoot.Background" Value="{ThemeResource MenuItemPressedBrush}" />
</VisualState.Setters>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="MenuItemTranslate" Storyboard.TargetProperty="X" To="1" Duration="0:0:0.05" />
<DoubleAnimation Storyboard.TargetName="MenuItemScale" Storyboard.TargetProperty="ScaleX" To="0.97" Duration="0:0:0.05" />
<DoubleAnimation Storyboard.TargetName="MenuItemScale" Storyboard.TargetProperty="ScaleY" To="0.97" Duration="0:0:0.05" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="LayoutRoot.Opacity" Value="0.45" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Segoe Fluent Icons is the Windows 11 glyph face; MDL2 remains the fallback
on Windows 10, where the newer family is not installed. -->
<FontFamily x:Key="SegoeFluentIcons">Segoe Fluent Icons,Segoe MDL2 Assets</FontFamily>
</ResourceDictionary>
</Application.Resources>
</Application>