Skip to content

Commit 09a6773

Browse files
Merge pull request #8578 from harshit7962/controlBatch1
Adding win11 styles to progressbar, label and statusbar
2 parents 354b4bf + 7c1ba0a commit 09a6773

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!--
2+
This Source Code Form is subject to the terms of the MIT License.
3+
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
4+
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
5+
All Rights Reserved.
6+
-->
7+
8+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
9+
10+
<Style TargetType="{x:Type Label}">
11+
<Setter Property="Padding" Value="0,0,0,4" />
12+
<Setter Property="Focusable" Value="False" />
13+
<Setter Property="Foreground" Value="{DynamicResource LabelForeground}" />
14+
<Setter Property="SnapsToDevicePixels" Value="True" />
15+
</Style>
16+
17+
</ResourceDictionary>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<!--
2+
This Source Code Form is subject to the terms of the MIT License.
3+
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
4+
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
5+
All Rights Reserved.
6+
-->
7+
8+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
9+
10+
<Style TargetType="{x:Type ProgressBar}">
11+
<Setter Property="Foreground" Value="{DynamicResource ProgressBarForeground}" />
12+
<Setter Property="Background" Value="{DynamicResource ProgressBarBackground}" />
13+
<Setter Property="BorderBrush" Value="{DynamicResource ProgressBarBorderBrush}" />
14+
<Setter Property="Height" Value="4" />
15+
<Setter Property="BorderThickness" Value="1" />
16+
<Setter Property="SnapsToDevicePixels" Value="True" />
17+
<Setter Property="OverridesDefaultStyle" Value="True" />
18+
<Setter Property="Template">
19+
<Setter.Value>
20+
<ControlTemplate TargetType="{x:Type ProgressBar}">
21+
<Grid Name="TemplateRoot" SnapsToDevicePixels="True">
22+
<Border
23+
Margin="1,1,1,1"
24+
Background="{TemplateBinding Background}"
25+
BorderBrush="{TemplateBinding BorderBrush}"
26+
BorderThickness="{TemplateBinding BorderThickness}"
27+
CornerRadius="1.5" />
28+
<Rectangle Name="PART_Track" Margin="1,1,1,1" />
29+
<Border
30+
Name="PART_Indicator"
31+
Margin="1,1,1,1"
32+
HorizontalAlignment="Left"
33+
Background="{TemplateBinding Foreground}"
34+
CornerRadius="2" />
35+
</Grid>
36+
</ControlTemplate>
37+
</Setter.Value>
38+
</Setter>
39+
<Style.Triggers>
40+
<Trigger Property="IsIndeterminate" Value="True">
41+
<Setter Property="Template">
42+
<Setter.Value>
43+
<ControlTemplate TargetType="{x:Type ProgressBar}">
44+
<Grid Name="TemplateRoot">
45+
<Border
46+
Margin="1,1,1,1"
47+
Background="{DynamicResource ProgressBarIndeterminateBackground}"
48+
BorderBrush="{DynamicResource ProgressBarIndeterminateBackground}"
49+
BorderThickness="{TemplateBinding BorderThickness}"
50+
CornerRadius="4" />
51+
<Rectangle Name="PART_Track" Margin="1,1,1,1" />
52+
<Decorator
53+
Name="PART_Indicator"
54+
Margin="1,1,1,1"
55+
HorizontalAlignment="Left">
56+
<Grid Name="Animation" ClipToBounds="True">
57+
<Border
58+
Name="PART_GlowRect"
59+
Width="200"
60+
Margin="0,0,0,0"
61+
HorizontalAlignment="Left"
62+
Background="{TemplateBinding Foreground}"
63+
CornerRadius="2" />
64+
</Grid>
65+
</Decorator>
66+
</Grid>
67+
</ControlTemplate>
68+
</Setter.Value>
69+
</Setter>
70+
</Trigger>
71+
</Style.Triggers>
72+
</Style>
73+
</ResourceDictionary>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<!--
2+
This Source Code Form is subject to the terms of the MIT License.
3+
If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
4+
Copyright (C) Leszek Pomianowski and WPF UI Contributors.
5+
All Rights Reserved.
6+
-->
7+
8+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
9+
10+
<Style x:Key="{x:Static StatusBar.SeparatorStyleKey}" TargetType="{x:Type Separator}">
11+
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
12+
<Setter Property="Background" Value="Transparent" />
13+
<Setter Property="Margin" Value="6,0" />
14+
<Setter Property="BorderThickness" Value="1,1,0,0" />
15+
<Setter Property="SnapsToDevicePixels" Value="True" />
16+
<Setter Property="OverridesDefaultStyle" Value="True" />
17+
<Setter Property="Template">
18+
<Setter.Value>
19+
<ControlTemplate TargetType="{x:Type Separator}">
20+
<Border
21+
Width="{TemplateBinding Width}"
22+
Margin="{TemplateBinding Margin}"
23+
Background="{TemplateBinding Background}"
24+
BorderBrush="{TemplateBinding BorderBrush}"
25+
BorderThickness="{TemplateBinding BorderThickness}" />
26+
</ControlTemplate>
27+
</Setter.Value>
28+
</Setter>
29+
</Style>
30+
31+
<Style TargetType="{x:Type StatusBar}">
32+
<Setter Property="Foreground">
33+
<Setter.Value>
34+
<SolidColorBrush Color="{DynamicResource TextFillColorPrimary}" />
35+
</Setter.Value>
36+
</Setter>
37+
<Setter Property="Background">
38+
<Setter.Value>
39+
<SolidColorBrush Color="{DynamicResource ControlFillColorDefault}" />
40+
</Setter.Value>
41+
</Setter>
42+
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
43+
<Setter Property="BorderThickness" Value="1" />
44+
<Setter Property="Padding" Value="12" />
45+
<Setter Property="Margin" Value="0" />
46+
</Style>
47+
48+
</ResourceDictionary>

0 commit comments

Comments
 (0)