Skip to content

Commit

Permalink
Slider: remove linear gradient brush from horizontal and vertical tra…
Browse files Browse the repository at this point in the history
…ck value style

RangeSlider: fix margin of the middle thumb
  • Loading branch information
punker76 committed Jan 21, 2018
1 parent de6311a commit 713cb69
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@
<RowDefinition Height="48" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#7A7A7A" Margin="-1 0 -1 0">
<Border Grid.Row="0"
Margin="-1 0 -1 0"
Background="#7A7A7A">
<TextBlock x:Name="Header"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Expand Down
58 changes: 14 additions & 44 deletions src/MahApps.Metro/MahApps.Metro/Styles/Controls.Slider.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,10 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Grid x:Name="Root" Margin="0 -1 0 0">
<Rectangle Height="5" Margin="0 1 0 0">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Offset="0.0" Color="{TemplateBinding Background}" />
<GradientStop Offset="0.25" Color="{DynamicResource AccentColor}" />
<GradientStop Offset="0.75" Color="{DynamicResource AccentColor}" />
<GradientStop Offset="1.0" Color="{TemplateBinding Background}" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver" />
<VisualState x:Name="Pressed" />
<VisualState x:Name="Disabled" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid Margin="0 -1 0 0">
<Rectangle Height="5"
Margin="0 1 0 0"
Fill="{DynamicResource AccentColorBrush}" />
</Grid>
</ControlTemplate>
</Setter.Value>
Expand Down Expand Up @@ -136,17 +121,17 @@
Visibility="Collapsed" />
<Track x:Name="PART_Track" Grid.Row="1">
<Track.DecreaseRepeatButton>
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource HorizontalTrackValue}" />
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{DynamicResource HorizontalTrackValue}" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource HorizontalTrackLargeDecrease}" />
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{DynamicResource HorizontalTrackLargeDecrease}" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<controls:MetroThumb x:Name="HorizontalThumb"
Width="{DynamicResource HorizontalThumbWidth}"
Height="{DynamicResource HorizontalThumbHeight}"
IsTabStop="True"
Style="{StaticResource HorizontalSliderThumb}" />
Style="{DynamicResource HorizontalSliderThumb}" />
</Track.Thumb>
</Track>
</Grid>
Expand Down Expand Up @@ -215,25 +200,10 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Grid x:Name="Root" Margin="-1 0 0 0">
<Rectangle Width="5" Margin="1 0 0 0">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Offset="0.0" Color="{TemplateBinding Background}" />
<GradientStop Offset="0.25" Color="{DynamicResource AccentColor}" />
<GradientStop Offset="0.75" Color="{DynamicResource AccentColor}" />
<GradientStop Offset="1.0" Color="{TemplateBinding Background}" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver" />
<VisualState x:Name="Pressed" />
<VisualState x:Name="Disabled" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid Margin="-1 0 0 0">
<Rectangle Width="5"
Margin="1 0 0 0"
Fill="{DynamicResource AccentColorBrush}" />
</Grid>
</ControlTemplate>
</Setter.Value>
Expand Down Expand Up @@ -262,17 +232,17 @@
Visibility="Collapsed" />
<Track x:Name="PART_Track" Grid.Column="1">
<Track.DecreaseRepeatButton>
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{StaticResource VerticalTrackValue}" />
<RepeatButton Command="{x:Static Slider.DecreaseLarge}" Style="{DynamicResource VerticalTrackValue}" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource VerticalTrackLargeDecrease}" />
<RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{DynamicResource VerticalTrackLargeDecrease}" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<controls:MetroThumb x:Name="VerticalThumb"
Width="{DynamicResource VerticalThumbWidth}"
Height="{DynamicResource VerticalThumbHeight}"
IsTabStop="True"
Style="{StaticResource VerticalSliderThumb}" />
Style="{DynamicResource VerticalSliderThumb}" />
</Track.Thumb>
</Track>
</Grid>
Expand Down
16 changes: 10 additions & 6 deletions src/MahApps.Metro/MahApps.Metro/Themes/RangeSlider.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Height="5"
Margin="0 1 0 0"
Fill="{DynamicResource AccentColorBrush}" />
<Grid Margin="0 -1 0 0">
<Rectangle Height="5"
Margin="0 1 0 0"
Fill="{DynamicResource AccentColorBrush}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down Expand Up @@ -111,9 +113,11 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Width="5"
Margin="0 0 0 0"
Fill="{DynamicResource AccentColorBrush}" />
<Grid Margin="-1 0 0 0">
<Rectangle Width="5"
Margin="1 0 0 0"
Fill="{DynamicResource AccentColorBrush}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
Expand Down

0 comments on commit 713cb69

Please sign in to comment.