Browse Source

fix window background interfering with titlebar and window dragging.

pull/4336/head
Dan Walmsley 6 years ago
parent
commit
d8604567ee
  1. 31
      src/Avalonia.Themes.Default/Window.xaml
  2. 19
      src/Avalonia.Themes.Fluent/Window.xaml

31
src/Avalonia.Themes.Default/Window.xaml

@ -1,23 +1,22 @@
<Style xmlns="https://github.com/avaloniaui" Selector="Window"> <Style xmlns="https://github.com/avaloniaui" Selector="Window">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}"/> <Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource SystemControlBackgroundAltHighBrush}" />
<Setter Property="FontSize" Value="{DynamicResource FontSizeNormal}"/> <Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/>
<Setter Property="FontSize" Value="{DynamicResource ContentControlFontSize}"/>
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Panel> <Panel>
<Panel IsHitTestVisible="False" Margin="{TemplateBinding OffScreenMargin}"> <Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> <Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
</Panel> <VisualLayerManager>
<Border Background="{TemplateBinding Background}"> <ContentPresenter Name="PART_ContentPresenter"
<VisualLayerManager> ContentTemplate="{TemplateBinding ContentTemplate}"
<ContentPresenter Name="PART_ContentPresenter" Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" </VisualLayerManager>
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
</VisualLayerManager>
</Border>
</Panel> </Panel>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>

19
src/Avalonia.Themes.Fluent/Window.xaml

@ -8,16 +8,15 @@
<ControlTemplate> <ControlTemplate>
<Panel> <Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> <Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}"> <Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
<VisualLayerManager> <VisualLayerManager>
<ContentPresenter Name="PART_ContentPresenter" <ContentPresenter Name="PART_ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}" ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}" Content="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}" Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
</VisualLayerManager> </VisualLayerManager>
</Border>
</Panel> </Panel>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>

Loading…
Cancel
Save