-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathTheme.xaml
More file actions
257 lines (243 loc) · 16.4 KB
/
Theme.xaml
File metadata and controls
257 lines (243 loc) · 16.4 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
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:ClassIsland.Controls;assembly=ClassIsland"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:ci="http://classisland.tech/schemas/xaml/core"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:classIsland="clr-namespace:ClassIsland;assembly=ClassIsland">
<ci:SolidColorBrushToColorConverter x:Key="SolidColorBrushToColorConverter"/>
<Style TargetType="{x:Type Grid}" x:Key="GridComponentPresenterContainerStyle">
<Style.Triggers>
<Trigger Property="IsVisible" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.00"/>
<EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
<EasingDoubleKeyFrame KeyTime="00:00:00.0000000" Value="-60"/>
<EasingDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0">
<EasingDoubleKeyFrame.EasingFunction>
<SineEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type ci:ComponentPresenter}" >
<Style.Triggers>
<Trigger Property="IsRootComponent" Value="True">
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="{x:Type ci:ComponentPresenter}">
<Grid Style="{StaticResource GridComponentPresenterContainerStyle}">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform />
<TranslateTransform Y="-60" />
</TransformGroup>
</Grid.RenderTransform>
<Border CornerRadius="10" Padding="15 0"
Background="{DynamicResource MaterialDesignBackground}"
Height="60"
Opacity="{Binding ViewModel.Settings.Opacity, RelativeSource={RelativeSource AncestorType=classIsland:MainWindow}}"
>
</Border>
<Border CornerRadius="10" Padding="15 0"
Height="60"
BorderBrush="{DynamicResource PrimaryHueMidBrush}" BorderThickness="0.75"
>
<Grid>
<Grid>
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Id}" Value="1db2017d-e374-4bc6-9d57-0b4adf03a6b8"/>
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Visible"/>
</MultiDataTrigger>
</Style.Triggers>
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
</Grid.Style>
<Canvas>
<!-- 这里可以替换成你喜欢的图片 -->
<Image Source="pack://application:,,,/ClassIsland;component/Assets/HoYoStickers/藿藿_好痛.png"
Height="80" Width="80" Stretch="UniformToFill"
Canvas.Top="-10" Canvas.Right="0"
Opacity="0.4">
</Image>
</Canvas>
</Grid>
<TextBlock Text="{Binding AssociatedComponentInfo.Name}" HorizontalAlignment="Center"
FontSize="12"
Margin="0 4 0 0"
Opacity="0.8"/>
<Grid Height="40" VerticalAlignment="Bottom">
<ContentPresenter Content="{Binding Content, RelativeSource={RelativeSource AncestorType= ci:ComponentPresenter}}" />
</Grid>
</Grid>
</Border>
<Border CornerRadius="10" Padding="15 0"
Height="60"
BorderBrush="{DynamicResource PrimaryHueMidBrush}" BorderThickness="0.75"
>
<Border.Effect>
<DropShadowEffect BlurRadius="8" ShadowDepth="0" Opacity="0.8" Color="{Binding BorderBrush, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Border}, Converter={StaticResource SolidColorBrushToColorConverter}}"/>
</Border.Effect>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<!-- 覆盖行容器外观,可以通过修改其中的控件模板来自定义行容器外观 -->
<Style BasedOn="{StaticResource MainWindowLineBaseStyle}" TargetType="{x:Type controls:MainWindowLine}">
<Style.Resources>
<!-- 行容器高度 -->
<system:Double x:Key="IslandContainerHeight">NaN</system:Double>
</Style.Resources>
<!-- <Setter Property="Height" Value="60"/> -->
<Style.Triggers>
<Trigger Property="IsMainLine" Value="False">
<Setter Property="Template">
<Setter.Value>
<!-- 行容器控件模板 -->
<ControlTemplate x:Key="MainWindowLineMinControlTemplate">
<Grid
ClipToBounds="True"
Style="{StaticResource DockingStyle}">
<Grid x:Name="PART_GridWrapper" ClipToBounds="True"
Height="{DynamicResource IslandContainerHeight}"
SnapsToDevicePixels="True"
Style="{StaticResource DockingStyle}">
<Grid Height="{DynamicResource IslandContainerHeight}"
x:Name="GridContentRoot"
Margin="12 0">
<ContentPresenter
Content="{Binding Content, RelativeSource={RelativeSource AncestorType=controls:MainWindowLine}}" />
</Grid>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Visibility" Value="{Binding IsAllComponentsHid, RelativeSource={RelativeSource Self}, Converter={StaticResource InverseBoolToVisConverter}}"/>
</Trigger>
</Style.Triggers>
<Setter Property="Template">
<Setter.Value>
<!-- 完整行容器控件模板 -->
<ControlTemplate x:Key="MainWindowLineFullControlTemplate">
<Grid>
<Grid.Effect>
<DropShadowEffect BlurRadius="8" Direction="0"
ShadowDepth="0" Opacity="0"
x:Name="RootDropShadowEffect"
Color="Black"/>
</Grid.Effect>
<Grid
ClipToBounds="True"
Style="{StaticResource DockingStyle}">
<!-- Background -->
<Border x:Name="BackgroundBorderOverlay"
Style="{StaticResource BackgroundBorderStyle}"
Width="{Binding ActualWidth, ElementName=BackgroundBorder, Mode=OneWay}"
Opacity="0"
SnapsToDevicePixels="True"
Height="{DynamicResource IslandContainerHeight}">
</Border>
<Grid
Style="{StaticResource DockingStyle}"
Width="{Binding BackgroundWidth, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType=controls:MainWindowLine}}"
Height="{DynamicResource IslandContainerHeight}"
SnapsToDevicePixels="True"
ClipToBounds="True">
<materialDesign:ColorZone x:Name="BackgroundBorderOverlayMask" Mode="PrimaryMid"
VerticalAlignment="Stretch"
RenderTransformOrigin="0.5,0.5">
<materialDesign:ColorZone.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform />
<TranslateTransform Y="-60" />
</TransformGroup>
</materialDesign:ColorZone.RenderTransform>
</materialDesign:ColorZone>
</Grid>
<Grid x:Name="PART_GridWrapper" ClipToBounds="True"
Height="{DynamicResource IslandContainerHeight}"
SnapsToDevicePixels="True"
Style="{StaticResource DockingStyle}">
<Grid Height="{DynamicResource IslandContainerHeight}"
x:Name="GridContentRoot"
Margin="12 0">
<ContentPresenter
Content="{Binding Content, RelativeSource={RelativeSource AncestorType=controls:MainWindowLine}}" />
</Grid>
<!-- Overlay View -->
<Grid x:Name="GridOverlay"
SnapsToDevicePixels="True"
ClipToBounds="True"
Opacity="0">
<Border Background="{DynamicResource MaterialDesignBackground}"
Opacity="{Binding ViewModel.Settings.Opacity, RelativeSource={RelativeSource AncestorType=classIsland:MainWindow}}"/>
<Border ClipToBounds="True">
<ProgressBar VerticalAlignment="Bottom"
Maximum="1"
Value="{Binding NotificationProgressBarValue, RelativeSource={RelativeSource AncestorType=classIsland:MainWindow}}"
x:Name="OverlayTimeProgressBar"
materialDesign:TransitionAssist.DisableTransitions="True"
Height="3"
Foreground="{DynamicResource PrimaryHueMidBrush}"
Background="Transparent"
BorderBrush="Transparent">
<ProgressBar.Effect>
<DropShadowEffect BlurRadius="12" ShadowDepth="0" Opacity="1" Color="{Binding Foreground, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ProgressBar}, Converter={StaticResource SolidColorBrushToColorConverter}}"/>
</ProgressBar.Effect>
</ProgressBar>
</Border>
<ContentPresenter
Content="{Binding ViewModel.CurrentOverlayElement, RelativeSource={RelativeSource FindAncestor, AncestorType=classIsland:MainWindow}}" />
</Grid>
<!-- Mask -->
<materialDesign:ColorZone x:Name="OverlayMask" Mode="PrimaryMid" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
RenderTransformOrigin="0.5,0.5"
SnapsToDevicePixels="True">
<materialDesign:ColorZone.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform />
<TranslateTransform Y="-60" />
</TransformGroup>
</materialDesign:ColorZone.RenderTransform>
<ContentPresenter x:Name="OverlayMaskContent"
Content="{Binding ViewModel.CurrentMaskElement, RelativeSource={RelativeSource FindAncestor, AncestorType=classIsland:MainWindow}}" />
</materialDesign:ColorZone>
</Grid>
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>