Browse Source

Selector rework

pull/1842/head
Benedikt Schroeder 8 years ago
parent
commit
ab97dbb12c
  1. 5
      samples/ControlCatalog/SideBar.xaml
  2. 16
      src/Avalonia.Themes.Default/TabItem.xaml

5
samples/ControlCatalog/SideBar.xaml

@ -39,7 +39,7 @@
</Setter> </Setter>
</Style> </Style>
<Style Selector="TabControl.sidebar > TabItem"> <Style Selector="TabControl.sidebar > TabItem">
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="White"/> <Setter Property="Foreground" Value="White"/>
<Setter Property="FontSize" Value="14"/> <Setter Property="FontSize" Value="14"/>
@ -52,11 +52,10 @@
</Transitions> </Transitions>
</Setter> </Setter>
</Style> </Style>
<Style Selector="TabControl.sidebar > TabItem:pointerover"> <Style Selector="TabControl.sidebar > TabItem:pointerover">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Opacity" Value="1"/> <Setter Property="Opacity" Value="1"/>
</Style> </Style>
<Style Selector="TabControl.sidebar > TabItem:selected"> <Style Selector="TabControl.sidebar > TabItem:selected">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/> <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/>
<Setter Property="Opacity" Value="1"/> <Setter Property="Opacity" Value="1"/>

16
src/Avalonia.Themes.Default/TabItem.xaml

@ -1,6 +1,8 @@
<Styles xmlns="https://github.com/avaloniaui"> <Styles xmlns="https://github.com/avaloniaui">
<Style Selector="TabItem"> <Style Selector="TabItem">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="FontSize" Value="{DynamicResource FontSizeLarge}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundLightBrush}"/>
<Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="2 1"/> <Setter Property="Padding" Value="2 1"/>
@ -23,23 +25,19 @@
<Style Selector="TabItem:disabled"> <Style Selector="TabItem:disabled">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}"/> <Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}"/>
</Style> </Style>
<Style Selector="TabItem:pointerover /template/ContentPresenter"> <Style Selector="TabItem:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemeControlHighlightMidBrush}"/> <Setter Property="Background" Value="{DynamicResource ThemeControlHighlightMidBrush}"/>
</Style> </Style>
<Style Selector="TabItem:selected">
<Style Selector="TabItem:selected /template/ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush4}"/> <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush4}"/>
</Style> </Style>
<Style Selector="TabItem:selected:focus">
<Style Selector="TabItem:selected:focus /template/ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/> <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/>
</Style> </Style>
<Style Selector="TabItem:selected:pointerover">
<Style Selector="ListBoxItem:selected:pointerover /template/ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/> <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush3}"/>
</Style> </Style>
<Style Selector="TabItem:selected:focus:pointerover">
<Style Selector="ListBoxItem:selected:focus:pointerover /template/ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/> <Setter Property="Background" Value="{DynamicResource ThemeAccentBrush2}"/>
</Style> </Style>
</Styles> </Styles>

Loading…
Cancel
Save