|
24 | 24 | <Setter Property="FontSize" Value="13"/> |
25 | 25 | </Style> |
26 | 26 |
|
| 27 | + <Style TargetType="ComboBoxItem"> |
| 28 | + <Setter Property="Background" Value="{StaticResource Surface}"/> |
| 29 | + <Setter Property="Foreground" Value="{StaticResource TextPrimary}"/> |
| 30 | + <Setter Property="Padding" Value="10,6"/> |
| 31 | + <Setter Property="FontSize" Value="13"/> |
| 32 | + <Style.Triggers> |
| 33 | + <Trigger Property="IsHighlighted" Value="True"> |
| 34 | + <Setter Property="Background" Value="{StaticResource SurfaceLift}"/> |
| 35 | + <Setter Property="Foreground" Value="{StaticResource TextPrimary}"/> |
| 36 | + </Trigger> |
| 37 | + </Style.Triggers> |
| 38 | + </Style> |
| 39 | + |
| 40 | + <ControlTemplate x:Key="ComboBoxToggleTemplate" TargetType="ToggleButton"> |
| 41 | + <Border Background="Transparent"/> |
| 42 | + </ControlTemplate> |
| 43 | + |
27 | 44 | <Style TargetType="ComboBox"> |
28 | 45 | <Setter Property="Background" Value="{StaticResource Surface}"/> |
29 | 46 | <Setter Property="Foreground" Value="{StaticResource TextPrimary}"/> |
30 | 47 | <Setter Property="BorderBrush" Value="{StaticResource Border}"/> |
31 | 48 | <Setter Property="BorderThickness" Value="1"/> |
32 | 49 | <Setter Property="Padding" Value="8,6"/> |
33 | 50 | <Setter Property="FontSize" Value="13"/> |
| 51 | + <Setter Property="Template"> |
| 52 | + <Setter.Value> |
| 53 | + <ControlTemplate TargetType="ComboBox"> |
| 54 | + <Grid> |
| 55 | + <Border x:Name="border" |
| 56 | + Background="{TemplateBinding Background}" |
| 57 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 58 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 59 | + CornerRadius="6"> |
| 60 | + <Grid> |
| 61 | + <Grid.ColumnDefinitions> |
| 62 | + <ColumnDefinition Width="*"/> |
| 63 | + <ColumnDefinition Width="24"/> |
| 64 | + </Grid.ColumnDefinitions> |
| 65 | + <ContentPresenter Grid.Column="0" |
| 66 | + Content="{TemplateBinding SelectionBoxItem}" |
| 67 | + ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" |
| 68 | + Margin="{TemplateBinding Padding}" |
| 69 | + VerticalAlignment="Center" |
| 70 | + IsHitTestVisible="False"/> |
| 71 | + <Path Grid.Column="1" |
| 72 | + Data="M 0 0 L 4 4 L 8 0 Z" |
| 73 | + Fill="{StaticResource TextMuted}" |
| 74 | + HorizontalAlignment="Center" |
| 75 | + VerticalAlignment="Center" |
| 76 | + IsHitTestVisible="False"/> |
| 77 | + <ToggleButton Grid.ColumnSpan="2" |
| 78 | + Template="{StaticResource ComboBoxToggleTemplate}" |
| 79 | + Focusable="False" |
| 80 | + IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
| 81 | + ClickMode="Press"/> |
| 82 | + </Grid> |
| 83 | + </Border> |
| 84 | + <Popup Placement="Bottom" |
| 85 | + IsOpen="{TemplateBinding IsDropDownOpen}" |
| 86 | + AllowsTransparency="True" |
| 87 | + Focusable="False" |
| 88 | + PopupAnimation="Slide"> |
| 89 | + <Border Background="{StaticResource Surface}" |
| 90 | + BorderBrush="{StaticResource Border}" |
| 91 | + BorderThickness="1" |
| 92 | + CornerRadius="6" |
| 93 | + MinWidth="{TemplateBinding ActualWidth}" |
| 94 | + MaxHeight="{TemplateBinding MaxDropDownHeight}"> |
| 95 | + <ScrollViewer> |
| 96 | + <ItemsPresenter/> |
| 97 | + </ScrollViewer> |
| 98 | + </Border> |
| 99 | + </Popup> |
| 100 | + </Grid> |
| 101 | + <ControlTemplate.Triggers> |
| 102 | + <Trigger Property="IsMouseOver" Value="True"> |
| 103 | + <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource AccentBorder}"/> |
| 104 | + </Trigger> |
| 105 | + </ControlTemplate.Triggers> |
| 106 | + </ControlTemplate> |
| 107 | + </Setter.Value> |
| 108 | + </Setter> |
34 | 109 | </Style> |
35 | 110 |
|
36 | 111 | <Style TargetType="ListBox"> |
|
0 commit comments