Skip to content

Commit 592617d

Browse files
committed
Update UI elements in MainWindow and Styles
- Set background for main Grid in MainWindow.xaml for both UnoApp and WinUIApp. - Modify VisualState setters to use Indicator.Background instead of ContentPresenter.Background. - Add a new Separator Border for improved layout. - Simplify layout by removing unnecessary Grid structure around ContentPresenter.
1 parent a8ee92c commit 592617d

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

src/Examples/UnoApp/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:dock="using:WinUI.Dock"
55
x:Name="Main">
6-
<Grid>
6+
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
77
<Grid.RowDefinitions>
88
<RowDefinition Height="Auto" />
99
<RowDefinition Height="*" />

src/Examples/WinUIApp/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:dock="using:WinUI.Dock"
55
x:Name="Main">
6-
<Grid>
6+
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
77
<Grid.RowDefinitions>
88
<RowDefinition Height="Auto" />
99
<RowDefinition Height="*" />

src/WinUI.Dock/Themes/Styles.xaml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -93,29 +93,30 @@
9393
<VisualState x:Name="Normal" />
9494
<VisualState x:Name="PointerOver">
9595
<VisualState.Setters>
96-
<Setter Target="ContentPresenter.Background" Value="{ThemeResource TabViewItemHeaderBackgroundPointerOver}" />
96+
<Setter Target="Indicator.Opacity" Value="1" />
97+
<Setter Target="Indicator.Background" Value="{ThemeResource TabViewItemHeaderBackgroundPointerOver}" />
9798
</VisualState.Setters>
9899
</VisualState>
99100
<VisualState x:Name="Pressed" />
100101
<VisualState x:Name="Selected">
101102
<VisualState.Setters>
102103
<Setter Target="BottomLine.Opacity" Value="0" />
103104
<Setter Target="Indicator.Opacity" Value="1" />
104-
<Setter Target="ContentPresenter.Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
105+
<Setter Target="Indicator.Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
105106
</VisualState.Setters>
106107
</VisualState>
107108
<VisualState x:Name="PointerOverSelected">
108109
<VisualState.Setters>
109110
<Setter Target="BottomLine.Opacity" Value="0" />
110111
<Setter Target="Indicator.Opacity" Value="1" />
111-
<Setter Target="ContentPresenter.Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
112+
<Setter Target="Indicator.Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
112113
</VisualState.Setters>
113114
</VisualState>
114115
<VisualState x:Name="PressedSelected">
115116
<VisualState.Setters>
116117
<Setter Target="BottomLine.Opacity" Value="0" />
117118
<Setter Target="Indicator.Opacity" Value="1" />
118-
<Setter Target="ContentPresenter.Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
119+
<Setter Target="Indicator.Background" Value="{ThemeResource CardBackgroundFillColorDefaultBrush}" />
119120
</VisualState.Setters>
120121
</VisualState>
121122
</VisualStateGroup>
@@ -127,6 +128,20 @@
127128
VerticalAlignment="Bottom"
128129
Background="{TemplateBinding BorderBrush}" />
129130

131+
<Border x:Name="Separator"
132+
Grid.Column="1"
133+
Width="1"
134+
Margin="{ThemeResource TabViewItemSeparatorMargin}"
135+
HorizontalAlignment="Right"
136+
Background="{ThemeResource TabViewItemSeparator}" />
137+
138+
<Border x:Name="Indicator"
139+
Grid.Column="1"
140+
BorderBrush="{TemplateBinding BorderBrush}"
141+
BorderThickness="1,1,1,0"
142+
CornerRadius="4,4,0,0"
143+
Opacity="0" />
144+
130145
<ContentPresenter x:Name="ContentPresenter"
131146
Grid.Column="1"
132147
Padding="8,2,8,2"
@@ -139,21 +154,6 @@
139154
FontSize="{ThemeResource TabViewItemHeaderFontSize}"
140155
FontWeight="{TemplateBinding FontWeight}"
141156
Foreground="{ThemeResource TabViewItemHeaderForeground}" />
142-
143-
<Grid Grid.Column="1"
144-
IsHitTestVisible="False">
145-
<Border x:Name="Separator"
146-
Width="1"
147-
Margin="{ThemeResource TabViewItemSeparatorMargin}"
148-
HorizontalAlignment="Right"
149-
Background="{ThemeResource TabViewItemSeparator}" />
150-
151-
<Border x:Name="Indicator"
152-
BorderBrush="{TemplateBinding BorderBrush}"
153-
BorderThickness="1,1,1,0"
154-
CornerRadius="4,4,0,0"
155-
Opacity="0" />
156-
</Grid>
157157
</Grid>
158158
</ControlTemplate>
159159
</Setter.Value>

src/WinUI.Dock/WinUI.Dock.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
1313
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1414
<Title>$(AssemblyName)</Title>
15-
<Version>1.3.0</Version>
15+
<Version>1.3.1</Version>
1616
<Authors>qian-o</Authors>
1717
<Copyright>MIT</Copyright>
1818
<PackageReadmeFile>README.md</PackageReadmeFile>

0 commit comments

Comments
 (0)