Skip to content

Commit

Permalink
layout improvements for MaterialWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
spiegelp committed Feb 21, 2021
1 parent fb13b3b commit ca33fb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions MaterialDesignExtensions/Themes/MaterialWindowTemplates.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
</Style>
</Border.Style>
<Border Grid.Column="1" Grid.Row="1" BorderBrush="{TemplateBinding BorderBackgroundBrush}" Background="{TemplateBinding BorderBackgroundBrush}"
ClipToBounds="True"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border.Style>
<Style TargetType="{x:Type Border}">
Expand All @@ -241,7 +242,7 @@
</Grid.RowDefinitions>

<!-- window icon -->
<Image Source="{TemplateBinding TitleBarIcon}" Width="24" Height="24" Margin="8,0,8,0" VerticalAlignment="Center">
<Image Panel.ZIndex="2048" Source="{TemplateBinding TitleBarIcon}" Width="24" Height="24" Margin="8,0,8,0" VerticalAlignment="Center">
<Image.Visibility>
<MultiBinding Converter="{StaticResource windowTitleBarIconVisibilityConverter}">
<Binding Path="TitleBarIcon" RelativeSource="{RelativeSource TemplatedParent}" />
Expand All @@ -251,7 +252,7 @@
</Image>

<!-- window title -->
<Border Grid.Column="1" Height="32" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Grid.Column="1" Panel.ZIndex="2048" Height="32" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border.Visibility>
<MultiBinding Converter="{StaticResource windowTitleVisibilityConverter}">
<Binding Path="WindowStyle" RelativeSource="{RelativeSource TemplatedParent}" />
Expand Down Expand Up @@ -279,7 +280,7 @@
</Border>

<!-- caption buttons -->
<StackPanel Grid.Column="2" Orientation="Horizontal" Height="32" VerticalAlignment="Stretch">
<StackPanel Grid.Column="2" Panel.ZIndex="2048" Orientation="Horizontal" Height="32" VerticalAlignment="Stretch">
<StackPanel.Visibility>
<MultiBinding Converter="{StaticResource windowTitleVisibilityConverter}">
<Binding Path="WindowStyle" RelativeSource="{RelativeSource TemplatedParent}" />
Expand Down Expand Up @@ -349,7 +350,7 @@
</StackPanel>

<!-- window content -->
<Border Grid.ColumnSpan="3" Grid.Row="1" Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Grid.ColumnSpan="3" Grid.Row="1" Panel.ZIndex="2047" Background="{TemplateBinding Background}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<AdornerDecorator>
<ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}">
<ContentPresenter.Style>
Expand Down
2 changes: 1 addition & 1 deletion MaterialDesignExtensionsDemo/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<mde:AppBar x:Name="appBar" Grid.ColumnSpan="2" Title="Material Design Extensions" ShowNavigationDrawerButton="True">
<mde:AppBar x:Name="appBar" Grid.ColumnSpan="2" Panel.ZIndex="1024" Title="Material Design Extensions" ShowNavigationDrawerButton="True">
<!-- demo for app bar icon -->
<!--<mde:AppBar.AppIcon>
<md:PackIcon Kind="Volleyball" Foreground="White" Width="24" Height="24" />
Expand Down

0 comments on commit ca33fb6

Please sign in to comment.