Browse Source

fluent 2 - fix treeview resources

pull/21771/head
Emmanuel Hansen 3 weeks ago
parent
commit
39f02b22f5
  1. 2
      src/Avalonia.Themes.Fluent2/Accents/FluentControlResources.xaml
  2. 29
      src/Avalonia.Themes.Fluent2/Controls/TreeViewItem.xaml

2
src/Avalonia.Themes.Fluent2/Accents/FluentControlResources.xaml

@ -614,6 +614,7 @@
<StaticResource x:Key="ScrollBarPanningThumbBackgroundColor" ResourceKey="ControlStrongFillColorDefault" />
<StaticResource x:Key="ScrollBarPanningThumbBackground" ResourceKey="ControlStrongFillColorDefaultBrush" />
<StaticResource x:Key="ScrollBarButtonBackgroundDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
<StaticResource x:Key="TreeViewItemSelectionIndicatorForeground" ResourceKey="AccentFillColorDefaultBrush" />
<x:Double x:Key="ScrollBarSize">12</x:Double>
<x:Double x:Key="ScrollBarButtonArrowIconFontSize">8</x:Double>
@ -1381,6 +1382,7 @@
<StaticResource x:Key="TreeViewItemBorderBrushSelectedPointerOver" ResourceKey="SubtleFillColorTransparentBrush" />
<StaticResource x:Key="TreeViewItemBorderBrushSelectedPressed" ResourceKey="SubtleFillColorTransparentBrush" />
<StaticResource x:Key="TreeViewItemBorderBrushSelectedDisabled" ResourceKey="SubtleFillColorTransparentBrush" />
<StaticResource x:Key="TreeViewItemSelectionIndicatorForeground" ResourceKey="AccentFillColorDefaultBrush" />
<Thickness x:Key="TreeViewItemBorderThemeThickness">0</Thickness>
<x:Double x:Key="TreeViewItemMinHeight">28</x:Double>

29
src/Avalonia.Themes.Fluent2/Controls/TreeViewItem.xaml

@ -45,7 +45,7 @@
VerticalAlignment="Center">
<Path x:Name="ChevronPath"
Data="{StaticResource TreeViewItemCollapsedChevronPathData}"
Fill="{DynamicResource TextFillColorSecondaryBrush}"
Fill="{TemplateBinding Foreground}"
Stretch="Uniform"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
@ -113,15 +113,13 @@
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Margin="{TemplateBinding Padding}" />
</Grid>
<!-- WinUI selection indicator pill: 3x16, fully rounded ends, accent fill,
pinned to the left edge of the row (before indentation). Scale-animated
like the ListBoxItem one. -->
<Rectangle Name="SelectionIndicator"
Width="3"
Height="16"
RadiusX="1.5"
RadiusY="1.5"
Fill="{DynamicResource AccentFillColorDefaultBrush}"
Fill="{DynamicResource TreeViewItemSelectionIndicatorForeground}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
UseLayoutRounding="False"
@ -150,6 +148,9 @@
<Style Selector="^ /template/ Border#PART_LayoutRoot:pointerover > ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundPointerOver}" />
</Style>
<Style Selector="^ /template/ ToggleButton#PART_ExpandCollapseChevron">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundPointerOver}" />
</Style>
<!-- Pressed state -->
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot:pointerover">
@ -159,6 +160,9 @@
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot:pointerover > ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundPressed}" />
</Style>
<Style Selector="^:pressed /template/ ToggleButton#PART_ExpandCollapseChevron">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundPressed}" />
</Style>
<!-- Disabled state -->
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot">
@ -168,6 +172,9 @@
<Style Selector="^:disabled /template/ ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundDisabled}" />
</Style>
<Style Selector="^:disabled /template/ ToggleButton#PART_ExpandCollapseChevron">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundDisabled}" />
</Style>
<!-- Selected state -->
<Style Selector="^:selected /template/ Border#PART_LayoutRoot">
@ -177,6 +184,9 @@
<Style Selector="^:selected /template/ Border#PART_LayoutRoot > ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelected}" />
</Style>
<Style Selector="^:selected /template/ ToggleButton#PART_ExpandCollapseChevron">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelected}" />
</Style>
<!-- Selected PointerOver state -->
<Style Selector="^:selected /template/ Border#PART_LayoutRoot:pointerover">
@ -186,6 +196,9 @@
<Style Selector="^:selected /template/ Border#PART_LayoutRoot:pointerover > ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedPointerOver}" />
</Style>
<Style Selector="^:selected /template/ ToggleButton#PART_ExpandCollapseChevron">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedPointerOver}" />
</Style>
<!-- Selected Pressed state -->
<Style Selector="^:pressed:selected /template/ Border#PART_LayoutRoot:pointerover">
@ -195,6 +208,9 @@
<Style Selector="^:pressed:selected /template/ Border#PART_LayoutRoot:pointerover > ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedPressed}" />
</Style>
<Style Selector="^:pressed:selected /template/ ToggleButton#PART_ExpandCollapseChevron">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedPressed}" />
</Style>
<!-- Disabled Selected state -->
<Style Selector="^:disabled:selected /template/ Border#PART_LayoutRoot">
@ -204,6 +220,9 @@
<Style Selector="^:disabled:selected /template/ Border#PART_LayoutRoot > ContentPresenter#PART_HeaderPresenter">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedDisabled}" />
</Style>
<Style Selector="^:disabled:selected /template/ ToggleButton#PART_ExpandCollapseChevron">
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedDisabled}" />
</Style>
<!-- Selection indicator pill (WinUI SelectionIndicator) -->
<Style Selector="^:selected /template/ Rectangle#SelectionIndicator">

Loading…
Cancel
Save