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

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

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

Loading…
Cancel
Save