Skip to content

Commit

Permalink
Merge pull request #307 from Jackhammer88/master
Browse files Browse the repository at this point in the history
Update Expander.axaml
  • Loading branch information
SKProCH committed Oct 20, 2023
2 parents 583f426 + 4d8b000 commit 1a49c9c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
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>

0 comments on commit 1a49c9c

Please sign in to comment.