Browse Source

Simplify and improve DropDownGlyph in fluent ComboBox

pull/7837/head
robloo 4 years ago
parent
commit
8453258ed3
  1. 43
      src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml

43
src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml

@ -101,23 +101,17 @@
IsVisible="False" IsVisible="False"
HorizontalAlignment="Right" /> HorizontalAlignment="Right" />
<Viewbox UseLayoutRounding="False" <PathIcon x:Name="DropDownGlyph"
MinHeight="{DynamicResource ComboBoxMinHeight}" Grid.Row="1"
Grid.Row="1" Grid.Column="1"
Grid.Column="1" UseLayoutRounding="False"
IsHitTestVisible="False" IsHitTestVisible="False"
Margin="0,0,10,0" Height="12"
Height="12" Width="12"
Width="12" Margin="0,0,10,0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center">
<Panel>
<Panel Height="12"
Width="12" />
<Path x:Name="DropDownGlyph"
VerticalAlignment="Center" /> VerticalAlignment="Center" />
</Panel>
</Viewbox>
<Popup Name="PART_Popup" <Popup Name="PART_Popup"
WindowManagerAddShadowHint="False" WindowManagerAddShadowHint="False"
IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}" IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}"
@ -159,10 +153,9 @@
<Setter Property="IsVisible" Value="False" /> <Setter Property="IsVisible" Value="False" />
</Style> </Style>
<Style Selector="ComboBox /template/ Path#DropDownGlyph"> <Style Selector="ComboBox /template/ PathIcon#DropDownGlyph">
<Setter Property="Fill" Value="{DynamicResource ComboBoxDropDownGlyphForeground}" /> <Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForeground}" />
<Setter Property="Data" Value="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" /> <Setter Property="Data" Value="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" />
<Setter Property="Stretch" Value="Uniform" />
</Style> </Style>
<!-- PointerOver State --> <!-- PointerOver State -->
@ -195,8 +188,8 @@
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> <Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" />
</Style> </Style>
<Style Selector="ComboBox:disabled /template/ Path#DropDownGlyph"> <Style Selector="ComboBox:disabled /template/ PathIcon#DropDownGlyph">
<Setter Property="Fill" Value="{DynamicResource ComboBoxDropDownGlyphForegroundDisabled}" /> <Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundDisabled}" />
</Style> </Style>
<!-- Focused State --> <!-- Focused State -->
@ -213,8 +206,8 @@
<Setter Property="TextBlock.Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" /> <Setter Property="TextBlock.Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" />
</Style> </Style>
<Style Selector="ComboBox:focus-visible /template/ Path#DropDownGlyph"> <Style Selector="ComboBox:focus-visible /template/ PathIcon#DropDownGlyph">
<Setter Property="Fill" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocused}" /> <Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocused}" />
</Style> </Style>
<!-- Focus Pressed State --> <!-- Focus Pressed State -->
@ -226,8 +219,8 @@
<Setter Property="TextBlock.Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundFocusedPressed}" /> <Setter Property="TextBlock.Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundFocusedPressed}" />
</Style> </Style>
<Style Selector="ComboBox:focused:pressed /template/ Path#DropDownGlyph"> <Style Selector="ComboBox:focused:pressed /template/ PathIcon#DropDownGlyph">
<Setter Property="Fill" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocusedPressed}" /> <Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocusedPressed}" />
</Style> </Style>
<!-- Error State --> <!-- Error State -->

Loading…
Cancel
Save