Browse Source

Updated ComboBox style

CPKreuz 2 years ago
parent
commit
54f56e418f

+ 13 - 4
src/PixiEditor/Styles/ComboBoxDarkStyle.xaml

@@ -11,7 +11,7 @@
     <SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#2F2F37" />
     <SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#2F2F37" />
     <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent" />
     <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent" />
     <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent" />
     <SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent" />
-    <SolidColorBrush x:Key="ComboBox.MouseOver.Background" Color="#333333" />
+    <SolidColorBrush x:Key="ComboBox.MouseOver.Background" Color="White" />
     <SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="#FF0000" />
     <SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="#FF0000" />
     <SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#007ACC" />
     <SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#007ACC" />
     <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="#333333" />
     <SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="#333333" />
@@ -42,12 +42,21 @@
                 <ControlTemplate TargetType="{x:Type ToggleButton}">
                 <ControlTemplate TargetType="{x:Type ToggleButton}">
                     <Border x:Name="templateRoot" Background="{StaticResource AccentColor}"
                     <Border x:Name="templateRoot" Background="{StaticResource AccentColor}"
                             BorderThickness="{TemplateBinding BorderThickness}"
                             BorderThickness="{TemplateBinding BorderThickness}"
-                            CornerRadius="5"
                             BorderBrush="{StaticResource ComboBox.Static.Border}" SnapsToDevicePixels="true">
                             BorderBrush="{StaticResource ComboBox.Static.Border}" SnapsToDevicePixels="true">
                         <Path x:Name="arrow"
                         <Path x:Name="arrow"
                             Data="M 0 3 L 3 6 L 6 3 L 6 0 L 3 3 L 0 0 L 0 3 Z"
                             Data="M 0 3 L 3 6 L 6 3 L 6 0 L 3 3 L 0 0 L 0 3 Z"
                             Fill="{StaticResource BrighterAccentColor}" HorizontalAlignment="Right" Margin="5"
                             Fill="{StaticResource BrighterAccentColor}" HorizontalAlignment="Right" Margin="5"
                             VerticalAlignment="Center" />
                             VerticalAlignment="Center" />
+                        <Border.Style>
+                            <Style TargetType="Border">
+                                <Setter Property="CornerRadius" Value="5"/>
+                                <Style.Triggers>
+                                    <DataTrigger Binding="{Binding IsChecked, RelativeSource={RelativeSource TemplatedParent}}" Value="true">
+                                        <Setter Property="CornerRadius" Value="5,5,0,0"/>
+                                    </DataTrigger>
+                                </Style.Triggers>
+                            </Style>
+                        </Border.Style>
                     </Border>
                     </Border>
                     <ControlTemplate.Triggers>
                     <ControlTemplate.Triggers>
                         <MultiDataTrigger>
                         <MultiDataTrigger>
@@ -103,10 +112,10 @@
             <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2"
             <Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2"
                    IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                    IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
                    Margin="1" Placement="Bottom">
                    Margin="1" Placement="Bottom">
-                <theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" CornerRadius="5"
+                <theme:SystemDropShadowChrome x:Name="shadow" Color="Transparent" CornerRadius="0,0,5,5"
                                               MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
                                               MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
                                               MaxHeight="{TemplateBinding MaxDropDownHeight}">
                                               MaxHeight="{TemplateBinding MaxDropDownHeight}">
-                    <Border x:Name="dropDownBorder" CornerRadius="5"
+                    <Border x:Name="dropDownBorder" CornerRadius="0,0,5,5"
                             Background="{StaticResource DarkerAccentColor}" BorderThickness="1"
                             Background="{StaticResource DarkerAccentColor}" BorderThickness="1"
                             BorderBrush="{StaticResource BrighterAccentColor}">
                             BorderBrush="{StaticResource BrighterAccentColor}">
                         <ScrollViewer x:Name="DropDownScrollViewer" Margin="1">
                         <ScrollViewer x:Name="DropDownScrollViewer" Margin="1">

+ 13 - 13
src/PixiEditor/Views/Dialogs/SettingsWindow.xaml

@@ -73,18 +73,6 @@
                     <ComboBox.ItemTemplate>
                     <ComboBox.ItemTemplate>
                         <DataTemplate>
                         <DataTemplate>
                             <StackPanel Orientation="Horizontal">
                             <StackPanel Orientation="Horizontal">
-                                <StackPanel.Style>
-                                    <Style TargetType="{x:Type StackPanel}">
-                                        <Style.Triggers>
-                                            <Trigger Property="IsMouseOver" Value="True">
-                                                <Setter Property="Background" Value="{StaticResource AccentColor}"/>
-                                            </Trigger>
-                                            <Trigger Property="IsMouseOver" Value="False">
-                                                <Setter Property="Background" Value="Transparent"/>
-                                            </Trigger>
-                                        </Style.Triggers>
-                                    </Style>
-                                </StackPanel.Style>
                                 <Image VerticalAlignment="Center" Margin="5 0" Source="{Binding IconPath}"/>
                                 <Image VerticalAlignment="Center" Margin="5 0" Source="{Binding IconPath}"/>
                                 <TextBlock VerticalAlignment="Center" Text="{Binding Name}"/>
                                 <TextBlock VerticalAlignment="Center" Text="{Binding Name}"/>
                             </StackPanel>
                             </StackPanel>
@@ -95,8 +83,20 @@
                             <Setter Property="Template">
                             <Setter Property="Template">
                                 <Setter.Value>
                                 <Setter.Value>
                                     <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                                     <ControlTemplate TargetType="{x:Type ComboBoxItem}">
-                                        <Border Height="25" Margin="5 0" Background="Transparent" BorderBrush="Transparent" BorderThickness="1">
+                                        <Border Height="25" Margin="0" Padding="5,0">
                                             <ContentPresenter/>
                                             <ContentPresenter/>
+                                            <Border.Style>
+                                                <Style TargetType="{x:Type Border}">
+                                                    <Style.Triggers>
+                                                        <Trigger Property="IsMouseOver" Value="False">
+                                                            <Setter Property="Background" Value="Transparent"/>
+                                                        </Trigger>
+                                                        <Trigger Property="IsMouseOver" Value="True">
+                                                            <Setter Property="Background" Value="{StaticResource MainColor}"/>
+                                                        </Trigger>
+                                                    </Style.Triggers>
+                                                </Style>
+                                            </Border.Style>
                                         </Border>
                                         </Border>
                                     </ControlTemplate>
                                     </ControlTemplate>
                                 </Setter.Value>
                                 </Setter.Value>