فهرست منبع

Removed a few unneeded styles I missed.

And tweak some designer previews.
Steven Kirk 3 سال پیش
والد
کامیت
534ccd8c13

+ 10 - 5
src/Avalonia.Themes.Fluent/Controls/CalendarItem.xaml

@@ -91,7 +91,11 @@
                       Padding="1"
                       HorizontalContentAlignment="Left">
                 <!--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 Name="NextButton"
                       Grid.Column="2"
@@ -100,7 +104,11 @@
                       Padding="1"
                       HorizontalContentAlignment="Left">
                 <!--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>
             </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-->
@@ -147,9 +155,6 @@
         </Border>
       </ControlTemplate>
     </Setter>
-    <Style Selector="^ /template/ Button > Path">
-      <Setter Property="Stroke" Value="{DynamicResource CalendarViewForeground}" />
-    </Style>
     <Style Selector="^ /template/ Button:pointerover > Path">
       <Setter Property="Stroke" Value="{DynamicResource CalendarViewNavigationButtonForegroundPointerOver}" />
     </Style>

+ 0 - 4
src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml

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

+ 4 - 2
src/Avalonia.Themes.Fluent/Controls/DateTimePickerShared.xaml

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

+ 8 - 9
src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml

@@ -68,18 +68,17 @@
           <Panel x:Name="PART_ScrollBarsSeparator"
                  Grid.Row="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>
       </ControlTemplate>
     </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">
       <Setter Property="Opacity" Value="1" />
     </Style>

+ 27 - 20
src/Avalonia.Themes.Fluent/Controls/Slider.xaml

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

+ 0 - 4
src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml

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