diff options
author | sr55 <[email protected]> | 2016-07-30 11:47:34 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2016-07-30 11:47:40 +0100 |
commit | 327986c2fb0294e77c72e4f40e9cdd071d05ad13 (patch) | |
tree | ad456f1333918a045529df8c5a49e7aa8bc0111d /win/CS/HandBrakeWPF/Views | |
parent | 40fbf61af177aebbe75d2d38c13ca29dfc448ec0 (diff) |
WinGui: Refix styling and layout on the Drive Listbox so it scrolls correctly. Fixes #263
Diffstat (limited to 'win/CS/HandBrakeWPF/Views')
-rw-r--r-- | win/CS/HandBrakeWPF/Views/Styles/Styles.xaml | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml b/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml index 66eb49078..c121190a5 100644 --- a/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml +++ b/win/CS/HandBrakeWPF/Views/Styles/Styles.xaml @@ -52,4 +52,40 @@ </Setter>
</Style>
+ <Style x:Key="hoverlessListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
+ <Setter Property="Background" Value="Transparent"/>
+ <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
+ <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
+ <Setter Property="Padding" Value="2,0,0,0"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type ListBoxItem}">
+ <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
+ <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsSelected" Value="true">
+ <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
+ <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
+ </Trigger>
+ <MultiTrigger>
+ <MultiTrigger.Conditions>
+ <Condition Property="IsSelected" Value="true"/>
+ <Condition Property="Selector.IsSelectionActive" Value="false"/>
+ </MultiTrigger.Conditions>
+ <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
+ <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}"/>
+ </MultiTrigger>
+ <Trigger Property="IsEnabled" Value="false">
+ <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
+ </Trigger>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter Property="Background" Value="Transparent"/>
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
</ResourceDictionary>
\ No newline at end of file |