Browse Source

fluent 2 - fix listbox resource item names

pull/21771/head
Emmanuel Hansen 3 weeks ago
parent
commit
d60b5432be
  1. 4
      src/Avalonia.Themes.Fluent2/Accents/FluentControlResources.xaml
  2. 16
      src/Avalonia.Themes.Fluent2/Controls/ListBoxItem.xaml

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

@ -184,6 +184,8 @@
<StaticResource x:Key="ListBoxItemBackgroundSelected" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ListBoxItemBackgroundSelectedPointerOver" ResourceKey="SystemControlHighlightListAccentMediumBrush" />
<StaticResource x:Key="ListBoxItemBackgroundSelectedPressed" ResourceKey="SystemControlHighlightListAccentHighBrush" />
<StaticResource x:Key="ListViewItemSelectionIndicatorBrush" ResourceKey="AccentFillColorDefaultBrush" />
<StaticResource x:Key="ListViewItemSelectionIndicatorDisabledBrush" ResourceKey="AccentFillColorDisabledBrush" />
<!-- Resources for ProgressBar.xaml -->
<x:Double x:Key="ProgressBarThemeMinHeight">3</x:Double>
@ -893,6 +895,8 @@
<StaticResource x:Key="ListBoxItemBackgroundSelected" ResourceKey="SystemControlHighlightListAccentLowBrush" />
<StaticResource x:Key="ListBoxItemBackgroundSelectedPointerOver" ResourceKey="SystemControlHighlightListAccentMediumBrush" />
<StaticResource x:Key="ListBoxItemBackgroundSelectedPressed" ResourceKey="SystemControlHighlightListAccentHighBrush" />
<StaticResource x:Key="ListViewItemSelectionIndicatorBrush" ResourceKey="AccentFillColorDefaultBrush" />
<StaticResource x:Key="ListViewItemSelectionIndicatorDisabledBrush" ResourceKey="AccentFillColorDisabledBrush" />
<!-- Resources for ProgressBar.xaml -->
<x:Double x:Key="ProgressBarThemeMinHeight">3</x:Double>

16
src/Avalonia.Themes.Fluent2/Controls/ListBoxItem.xaml

@ -64,7 +64,7 @@
IsHitTestVisible="False"
UseLayoutRounding="False"
RenderTransform="scaleY(0)"
Fill="{DynamicResource AccentFillColorDefaultBrush}">
Fill="{DynamicResource ListViewItemSelectionIndicatorBrush}">
<Rectangle.Transitions>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="{StaticResource ControlFastAnimationDuration}" Easing="0,0 0,1" />
@ -81,13 +81,13 @@
<!-- PointerOver State -->
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ListBoxItemBackgroundPointerOver}" />
<Setter Property="Foreground" Value="{DynamicResource ListBoxItemForeground}" />
</Style>
<!-- Pressed State -->
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ListBoxItemBackgroundPressed}" />
<Setter Property="Foreground" Value="{DynamicResource ListBoxItemForeground}" />
</Style>
@ -95,7 +95,7 @@
<Style Selector="^:selected">
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ListBoxItemBackgroundPointerOver}" />
<Setter Property="Foreground" Value="{DynamicResource ListBoxItemForeground}" />
</Style>
@ -105,24 +105,24 @@
</Style>
<Style Selector="^:disabled /template/ Rectangle#SelectionIndicator">
<Setter Property="Fill" Value="{DynamicResource AccentFillColorDisabledBrush}" />
<Setter Property="Fill" Value="{DynamicResource ListViewItemSelectionIndicatorDisabledBrush}" />
</Style>
<!-- Selected Unfocused State -->
<Style Selector="^:not(:focus) /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ListBoxItemBackgroundPointerOver}" />
<Setter Property="Foreground" Value="{DynamicResource ListBoxItemForeground}" />
</Style>
<!-- Selected PointerOver State -->
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ListBoxItemBackgroundPressed}" />
<Setter Property="Foreground" Value="{DynamicResource ListBoxItemForeground}" />
</Style>
<!-- Selected Pressed State -->
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
<Setter Property="Background" Value="{DynamicResource ListBoxItemBackgroundPointerOver}" />
<Setter Property="Foreground" Value="{DynamicResource ListBoxItemForeground}" />
</Style>
</Style>

Loading…
Cancel
Save