Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Expander.axaml #307

Merged
merged 3 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Material.Styles/Resources/Themes/Expander.axaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:assists="clr-namespace:Material.Styles.Assists"
xmlns:controls="clr-namespace:Material.Styles.Controls">
Expand All @@ -7,7 +7,8 @@
<Setter Property="ClipToBounds" Value="False" />
<Setter Property="Height" Value="48" />
<Setter Property="assists:ToggleButtonAssist.UncheckedBackground" Value="Transparent" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<ControlTemplate>
Expand All @@ -22,6 +23,9 @@
Name="PART_ContentPresenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
TextBlock.TextAlignment="{TemplateBinding TextBlock.TextAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
<Border Grid.Column="1"
Expand Down Expand Up @@ -99,6 +103,7 @@
</ControlTheme>

<ControlTheme x:Key="MaterialExpander" TargetType="Expander">
<Setter Property="TextBlock.TextAlignment" Value="Start" />
<Setter Property="ClipToBounds" Value="False" />
<Setter Property="CornerRadius" Value="4" />
<!-- Content transition will not work
Expand Down Expand Up @@ -233,4 +238,4 @@

<ControlTheme x:Key="{x:Type Expander}" TargetType="Expander"
BasedOn="{StaticResource MaterialExpander}" />
</ResourceDictionary>
</ResourceDictionary>
25 changes: 12 additions & 13 deletions Material.Styles/Resources/Themes/TabControl.axaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:assists="clr-namespace:Material.Styles.Assists">
<ResourceDictionary.MergedDictionaries>
Expand All @@ -17,6 +17,15 @@
Value="{DynamicResource MaterialBodyLightBrush}" />
<Setter Property="assists:TabControlAssist.TabHeaderInactiveOpacity" Value="1" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="ItemsPanel">
<ItemsPanelTemplate>
<UniformGrid Name="PART_TabContainer"
HorizontalAlignment="{TemplateBinding assists:TabControlAssist.TabHeaderHorizontalAlignment}"
VerticalAlignment="{TemplateBinding assists:TabControlAssist.TabHeaderVerticalAlignment}"
Background="{TemplateBinding Background}"
ZIndex="1" />
</ItemsPanelTemplate>
</Setter>
<Setter Property="Template">
<ControlTemplate>
<Border Name="PART_RootBorder"
Expand All @@ -26,17 +35,7 @@
CornerRadius="{TemplateBinding CornerRadius}">
<DockPanel Name="PART_RootPanel">
<Panel Name="PART_TabsPanel">
<ItemsPresenter Name="PART_ItemsPresenter">
<ItemsPresenter.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Name="PART_TabContainer"
HorizontalAlignment="{TemplateBinding assists:TabControlAssist.TabHeaderHorizontalAlignment}"
VerticalAlignment="{TemplateBinding assists:TabControlAssist.TabHeaderVerticalAlignment}"
Background="Transparent"
ZIndex="1" />
</ItemsPanelTemplate>
</ItemsPresenter.ItemsPanel>
</ItemsPresenter>
<ItemsPresenter Name="PART_ItemsPresenter" ItemsPanel="{TemplateBinding ItemsPanel}" />

<Rectangle Name="PART_Separator"
Fill="{TemplateBinding assists:TabControlAssist.TabHeaderInactiveBrush}" />
Expand Down Expand Up @@ -266,4 +265,4 @@
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
</ResourceDictionary>