Browse Source

Removed a few unneeded styles I missed.

And tweak some designer previews.
pull/8479/head
Steven Kirk 4 years ago
parent
commit
534ccd8c13
  1. 15
      src/Avalonia.Themes.Fluent/Controls/CalendarItem.xaml
  2. 4
      src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml
  3. 6
      src/Avalonia.Themes.Fluent/Controls/DateTimePickerShared.xaml
  4. 17
      src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml
  5. 47
      src/Avalonia.Themes.Fluent/Controls/Slider.xaml
  6. 4
      src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml

15
src/Avalonia.Themes.Fluent/Controls/CalendarItem.xaml

@ -91,7 +91,11 @@
Padding="1" Padding="1"
HorizontalContentAlignment="Left"> HorizontalContentAlignment="Left">
<!--Path mimics Segoe MDL2 Assets font glyph used in WinUI--> <!--Path mimics Segoe MDL2 Assets font glyph used in WinUI-->
<Path StrokeThickness="1.5" Data="M 0,9 L 9,0 L 18,9" HorizontalAlignment="Center" VerticalAlignment="Center" /> <Path Stroke="{DynamicResource CalendarViewForeground}"
StrokeThickness="1.5"
Data="M 0,9 L 9,0 L 18,9"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button> </Button>
<Button Name="NextButton" <Button Name="NextButton"
Grid.Column="2" Grid.Column="2"
@ -100,7 +104,11 @@
Padding="1" Padding="1"
HorizontalContentAlignment="Left"> HorizontalContentAlignment="Left">
<!--Path mimics Segoe MDL2 Assets font glyph used in WinUI--> <!--Path mimics Segoe MDL2 Assets font glyph used in WinUI-->
<Path StrokeThickness="1.5" Data="M 0,0 L 9,9 L 18,0" HorizontalAlignment="Center" VerticalAlignment="Center" /> <Path Stroke="{DynamicResource CalendarViewForeground}"
StrokeThickness="1.5"
Data="M 0,0 L 9,9 L 18,0"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
</Button> </Button>
</Grid> </Grid>
<!--Border below is used only for MonthView but it can't be moved inside of Grid because CalendarItem expects it to be empty and it will cause side-effects--> <!--Border below is used only for MonthView but it can't be moved inside of Grid because CalendarItem expects it to be empty and it will cause side-effects-->
@ -147,9 +155,6 @@
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ Button > Path">
<Setter Property="Stroke" Value="{DynamicResource CalendarViewForeground}" />
</Style>
<Style Selector="^ /template/ Button:pointerover > Path"> <Style Selector="^ /template/ Button:pointerover > Path">
<Setter Property="Stroke" Value="{DynamicResource CalendarViewNavigationButtonForegroundPointerOver}" /> <Setter Property="Stroke" Value="{DynamicResource CalendarViewNavigationButtonForegroundPointerOver}" />
</Style> </Style>

4
src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml

@ -280,10 +280,6 @@
</Setter> </Setter>
<Style Selector="^ /template/ Panel"> <Style Selector="^ /template/ Panel">
<Style Selector="^ RepeatButton">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^:pointerover RepeatButton"> <Style Selector="^:pointerover RepeatButton">
<Setter Property="IsVisible" Value="True" /> <Setter Property="IsVisible" Value="True" />
</Style> </Style>

6
src/Avalonia.Themes.Fluent/Controls/DateTimePickerShared.xaml

@ -15,8 +15,8 @@
<ListBoxItem Theme="{DynamicResource FluentDateTimePickerItem}">Standard Item</ListBoxItem> <ListBoxItem Theme="{DynamicResource FluentDateTimePickerItem}">Standard Item</ListBoxItem>
<ListBoxItem Theme="{DynamicResource FluentDateTimePickerItem}" Classes="MonthItem">Month Item</ListBoxItem> <ListBoxItem Theme="{DynamicResource FluentDateTimePickerItem}" Classes="MonthItem">Month Item</ListBoxItem>
<RepeatButton Theme="{DynamicResource FluentDateTimePickerButton}">Button</RepeatButton> <RepeatButton Theme="{DynamicResource FluentDateTimePickerButton}">Button</RepeatButton>
<RepeatButton Theme="{DynamicResource FluentDateTimePickerUpButton}"/> <RepeatButton Theme="{DynamicResource FluentDateTimePickerUpButton}" IsVisible="True"/>
<RepeatButton Theme="{DynamicResource FluentDateTimePickerDownButton}"/> <RepeatButton Theme="{DynamicResource FluentDateTimePickerDownButton}" IsVisible="True"/>
</StackPanel> </StackPanel>
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
@ -90,6 +90,7 @@
<Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Focusable" Value="False" /> <Setter Property="Focusable" Value="False" />
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" /> <Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" />
<Setter Property="IsVisible" Value="False"/>
<Setter Property="Content"> <Setter Property="Content">
<Template> <Template>
<Viewbox Height="10" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center"> <Viewbox Height="10" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center">
@ -105,6 +106,7 @@
<Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Focusable" Value="False" /> <Setter Property="Focusable" Value="False" />
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" /> <Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" />
<Setter Property="IsVisible" Value="False"/>
<Setter Property="Content"> <Setter Property="Content">
<Template> <Template>
<Viewbox Height="10" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center"> <Viewbox Height="10" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center">

17
src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml

@ -68,18 +68,17 @@
<Panel x:Name="PART_ScrollBarsSeparator" <Panel x:Name="PART_ScrollBarsSeparator"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Background="{DynamicResource ScrollViewerScrollBarsSeparatorBackground}" /> Background="{DynamicResource ScrollViewerScrollBarsSeparatorBackground}"
Opacity="0">
<Panel.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.1" />
</Transitions>
</Panel.Transitions>
</Panel>
</Grid> </Grid>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^ /template/ Panel#PART_ScrollBarsSeparator">
<Setter Property="Opacity" Value="0" />
<Setter Property="Transitions">
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.1" />
</Transitions>
</Setter>
</Style>
<Style Selector="^[IsExpanded=true] /template/ Panel#PART_ScrollBarsSeparator"> <Style Selector="^[IsExpanded=true] /template/ Panel#PART_ScrollBarsSeparator">
<Setter Property="Opacity" Value="1" /> <Setter Property="Opacity" Value="1" />
</Style> </Style>

47
src/Avalonia.Themes.Fluent/Controls/Slider.xaml

@ -2,11 +2,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=netstandard"> xmlns:sys="clr-namespace:System;assembly=netstandard">
<Design.PreviewWith> <Design.PreviewWith>
<Border Margin="20" Width="200" Height="400"> <Border Margin="20" Width="400" Height="600">
<DockPanel LastChildFill="True"> <DockPanel LastChildFill="True">
<StackPanel Spacing="10" DockPanel.Dock="Top"> <StackPanel Spacing="10" DockPanel.Dock="Top">
<Slider Value="50" /> <Slider Value="50" />
<Slider IsDirectionReversed="True" Value="50" /> <Slider IsDirectionReversed="True" Value="50" />
<Slider Value="50" TickPlacement="TopLeft" TickFrequency="10"/>
<Slider Value="50" TickPlacement="BottomRight" TickFrequency="10"/>
<Slider Value="50" TickPlacement="Outside" TickFrequency="10"/>
<Slider IsEnabled="False" Value="50" /> <Slider IsEnabled="False" Value="50" />
<Slider Value="50"> <Slider Value="50">
<DataValidationErrors.Error> <DataValidationErrors.Error>
@ -22,6 +25,9 @@
<Slider Value="50" Orientation="Vertical" /> <Slider Value="50" Orientation="Vertical" />
<Slider IsDirectionReversed="True" Value="50" Orientation="Vertical" /> <Slider IsDirectionReversed="True" Value="50" Orientation="Vertical" />
<Slider IsEnabled="False" Orientation="Vertical" Value="50" /> <Slider IsEnabled="False" Orientation="Vertical" Value="50" />
<Slider Value="50" TickPlacement="TopLeft" TickFrequency="10" Orientation="Vertical" />
<Slider Value="50" TickPlacement="BottomRight" TickFrequency="10" Orientation="Vertical" />
<Slider Value="50" TickPlacement="Outside" TickFrequency="10" Orientation="Vertical" />
</StackPanel> </StackPanel>
</DockPanel> </DockPanel>
</Border> </Border>
@ -103,7 +109,9 @@
Margin="{DynamicResource SliderTopHeaderMargin}" Margin="{DynamicResource SliderTopHeaderMargin}"
TextElement.FontWeight="{DynamicResource SliderHeaderThemeFontWeight}" TextElement.FontWeight="{DynamicResource SliderHeaderThemeFontWeight}"
TextElement.Foreground="{DynamicResource SliderHeaderForeground}" /> TextElement.Foreground="{DynamicResource SliderHeaderForeground}" />
<Grid x:Name="SliderContainer" Grid.Row="1"> <Grid x:Name="SliderContainer"
Grid.Row="1"
Background="{DynamicResource SliderContainerBackground}">
<Grid.Styles> <Grid.Styles>
<Style Selector="TickBar"> <Style Selector="TickBar">
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" /> <Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" />
@ -129,7 +137,9 @@
Height="{DynamicResource SliderOutsideTickBarThemeHeight}" Height="{DynamicResource SliderOutsideTickBarThemeHeight}"
Margin="0,0,0,4" Margin="0,0,0,4"
VerticalAlignment="Bottom" VerticalAlignment="Bottom"
Placement="Top" /> Placement="Top"
IsVisible="False"
Fill="{DynamicResource SliderTickBarFill}"/>
<TickBar <TickBar
Name="BottomTickBar" Name="BottomTickBar"
Grid.Row="2" Grid.Row="2"
@ -142,7 +152,9 @@
Height="{DynamicResource SliderOutsideTickBarThemeHeight}" Height="{DynamicResource SliderOutsideTickBarThemeHeight}"
Margin="0,4,0,0" Margin="0,4,0,0"
VerticalAlignment="Top" VerticalAlignment="Top"
Placement="Bottom" /> Placement="Bottom"
IsVisible="False"
Fill="{DynamicResource SliderTickBarFill}" />
<Track <Track
Name="PART_Track" Name="PART_Track"
Grid.Row="1" Grid.Row="1"
@ -172,6 +184,7 @@
Height="{DynamicResource SliderHorizontalThumbHeight}" Height="{DynamicResource SliderHorizontalThumbHeight}"
Margin="0" Margin="0"
Padding="0" Padding="0"
Background="{DynamicResource SliderThumbBackground}"
BorderThickness="0" BorderThickness="0"
Theme="{StaticResource FluentSliderThumbTheme}" Theme="{StaticResource FluentSliderThumbTheme}"
DataContext="{TemplateBinding Value}"/> DataContext="{TemplateBinding Value}"/>
@ -202,7 +215,9 @@
Margin="{DynamicResource SliderTopHeaderMargin}" Margin="{DynamicResource SliderTopHeaderMargin}"
TextElement.FontWeight="{DynamicResource SliderHeaderThemeFontWeight}" TextElement.FontWeight="{DynamicResource SliderHeaderThemeFontWeight}"
TextElement.Foreground="{DynamicResource SliderHeaderForeground}" /> TextElement.Foreground="{DynamicResource SliderHeaderForeground}" />
<Grid x:Name="SliderContainer" Grid.Row="1"> <Grid x:Name="SliderContainer"
Grid.Row="1"
Background="{DynamicResource SliderContainerBackground}">
<Grid.Styles> <Grid.Styles>
<Style Selector="TickBar"> <Style Selector="TickBar">
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" /> <Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" />
@ -228,7 +243,9 @@
Width="{DynamicResource SliderOutsideTickBarThemeHeight}" Width="{DynamicResource SliderOutsideTickBarThemeHeight}"
Margin="0,0,4,0" Margin="0,0,4,0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Placement="Left" /> Placement="Left"
IsVisible="False"
Fill="{DynamicResource SliderTickBarFill}"/>
<TickBar <TickBar
Name="RightTickBar" Name="RightTickBar"
Grid.RowSpan="3" Grid.RowSpan="3"
@ -241,7 +258,9 @@
Width="{DynamicResource SliderOutsideTickBarThemeHeight}" Width="{DynamicResource SliderOutsideTickBarThemeHeight}"
Margin="4,0,0,0" Margin="4,0,0,0"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Placement="Right" /> Placement="Right"
IsVisible="False"
Fill="{DynamicResource SliderTickBarFill}"/>
<Track <Track
Name="PART_Track" Name="PART_Track"
Grid.RowSpan="3" Grid.RowSpan="3"
@ -272,6 +291,7 @@
Height="{DynamicResource SliderVerticalThumbHeight}" Height="{DynamicResource SliderVerticalThumbHeight}"
Margin="0" Margin="0"
Padding="0" Padding="0"
Background="{DynamicResource SliderThumbBackground}"
BorderThickness="0" BorderThickness="0"
Theme="{StaticResource FluentSliderThumbTheme}" Theme="{StaticResource FluentSliderThumbTheme}"
DataContext="{TemplateBinding Value}" /> DataContext="{TemplateBinding Value}" />
@ -285,19 +305,6 @@
</Setter> </Setter>
</Style> </Style>
<!-- Normal State -->
<Style Selector="^ /template/ Thumb">
<Setter Property="Background" Value="{DynamicResource SliderThumbBackground}" />
</Style>
<Style Selector="^ /template/ Grid#SliderContainer">
<Setter Property="Background" Value="{DynamicResource SliderContainerBackground}" />
</Style>
<Style Selector="^/template/ TickBar">
<Setter Property="IsVisible" Value="False" />
<Setter Property="Fill" Value="{DynamicResource SliderTickBarFill}" />
</Style>
<!-- TickBar Placement States --> <!-- TickBar Placement States -->
<Style Selector="^[TickPlacement=TopLeft] /template/ TickBar#LeftTickBar, ^[TickPlacement=Outside] /template/ TickBar#LeftTickBar"> <Style Selector="^[TickPlacement=TopLeft] /template/ TickBar#LeftTickBar, ^[TickPlacement=Outside] /template/ TickBar#LeftTickBar">

4
src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml

@ -309,10 +309,6 @@
</Setter> </Setter>
<Style Selector="^ /template/ Panel"> <Style Selector="^ /template/ Panel">
<Style Selector="^ RepeatButton">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^:pointerover RepeatButton"> <Style Selector="^:pointerover RepeatButton">
<Setter Property="IsVisible" Value="True" /> <Setter Property="IsVisible" Value="True" />
</Style> </Style>

Loading…
Cancel
Save