Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Scrollbar] Fix carat spacing to edges #4889

Merged
merged 10 commits into from
Apr 29, 2021
13 changes: 9 additions & 4 deletions dev/CommonStyles/ScrollBar_themeresources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@
<primitives:CornerRadiusFilterConverter x:Key="TopLeftCornerRadiusDoubleValueConverter2x" Filter="TopLeftValue" Scale="2"/>
<primitives:CornerRadiusFilterConverter x:Key="BottomRightCornerRadiusDoubleValueConverter2x" Filter="BottomRightValue" Scale="2"/>

<Thickness x:Key="ScrollBarHorizontalDecreaseMargin">1,0,0,0</Thickness>
<Thickness x:Key="ScrollBarHorizontalIncreaseMargin">0,0,1,0</Thickness>
<Thickness x:Key="ScrollBarVerticalDecreaseMargin">0,1,0,0</Thickness>
<Thickness x:Key="ScrollBarVerticalIncreaseMargin">0,0,0,1</Thickness>

<Style TargetType="ScrollBar" BasedOn="{StaticResource DefaultScrollBarStyle}" />

<Style x:Key="DefaultScrollBarStyle" TargetType="ScrollBar">
Expand Down Expand Up @@ -681,7 +686,7 @@
contract7NotPresent:RadiusX="{Binding Source={ThemeResource ScrollBarCornerRadius}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter2x}}"
contract7NotPresent:RadiusY="{Binding Source={ThemeResource ScrollBarCornerRadius}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter2x}}"
Opacity="0" Grid.ColumnSpan="5" Margin="0" StrokeThickness="{ThemeResource ScrollBarTrackBorderThemeThickness}" Fill="{ThemeResource ScrollBarTrackFill}" Stroke="{ThemeResource ScrollBarTrackStroke}" />
<RepeatButton x:Name="HorizontalSmallDecrease" Opacity="0" Grid.Column="0" MinHeight="{StaticResource ScrollBarSize}" IsTabStop="False" Interval="50" Margin="0" Template="{StaticResource HorizontalDecrementTemplate}" Width="{StaticResource ScrollBarSize}" AllowFocusOnInteraction="False" VerticalAlignment="Center" />
<RepeatButton x:Name="HorizontalSmallDecrease" Opacity="0" Grid.Column="0" MinHeight="{StaticResource ScrollBarSize}" IsTabStop="False" Interval="50" Margin="{ThemeResource ScrollBarHorizontalDecreaseMargin}" Template="{StaticResource HorizontalDecrementTemplate}" Width="{StaticResource ScrollBarSize}" AllowFocusOnInteraction="False" VerticalAlignment="Center" />
<RepeatButton x:Name="HorizontalLargeDecrease" Opacity="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsTabStop="False" Interval="50" Template="{StaticResource RepeatButtonTemplate}" Width="0" AllowFocusOnInteraction="False" />
<Thumb x:Name="HorizontalThumb"
Opacity="0"
Expand All @@ -700,7 +705,7 @@
</Thumb>

<RepeatButton x:Name="HorizontalLargeIncrease" Opacity="0" Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsTabStop="False" Interval="50" AllowFocusOnInteraction="False" Template="{StaticResource RepeatButtonTemplate}" />
<RepeatButton x:Name="HorizontalSmallIncrease" Opacity="0" Grid.Column="4" MinHeight="{StaticResource ScrollBarSize}" IsTabStop="False" Interval="50" Margin="0" Template="{StaticResource HorizontalIncrementTemplate}" Width="{StaticResource ScrollBarSize}" AllowFocusOnInteraction="False" VerticalAlignment="Center" />
<RepeatButton x:Name="HorizontalSmallIncrease" Opacity="0" Grid.Column="4" MinHeight="{StaticResource ScrollBarSize}" IsTabStop="False" Interval="50" Margin="{ThemeResource ScrollBarHorizontalIncreaseMargin}" Template="{StaticResource HorizontalIncrementTemplate}" Width="{StaticResource ScrollBarSize}" AllowFocusOnInteraction="False" VerticalAlignment="Center" />
</Grid>
<Grid x:Name="HorizontalPanningRoot" MinWidth="24" Visibility="Collapsed" Opacity="0" contract7Present:CornerRadius="{TemplateBinding CornerRadius}">
<Border x:Name="HorizontalPanningThumb" VerticalAlignment="Bottom" HorizontalAlignment="Left" Background="{ThemeResource ScrollBarPanningThumbBackground}" BorderThickness="0" Height="2" MinWidth="32" Margin="0,2,0,2"/>
Expand All @@ -720,7 +725,7 @@
contract7NotPresent:RadiusX="{Binding Source={ThemeResource ScrollBarCornerRadius}, Converter={StaticResource TopLeftCornerRadiusDoubleValueConverter2x}}"
contract7NotPresent:RadiusY="{Binding Source={ThemeResource ScrollBarCornerRadius}, Converter={StaticResource BottomRightCornerRadiusDoubleValueConverter2x}}"
Opacity="0" Grid.RowSpan="5" Margin="0" StrokeThickness="{ThemeResource ScrollBarTrackBorderThemeThickness}" Fill="{ThemeResource ScrollBarTrackFill}" Stroke="{ThemeResource ScrollBarTrackStroke}" />
<RepeatButton x:Name="VerticalSmallDecrease" Opacity="0" Height="{StaticResource ScrollBarSize}" MinWidth="{StaticResource ScrollBarSize}" IsTabStop="False" Interval="50" Margin="0" Grid.Row="0" Template="{StaticResource VerticalDecrementTemplate}" HorizontalAlignment="Center" />
<RepeatButton x:Name="VerticalSmallDecrease" Opacity="0" Height="{StaticResource ScrollBarSize}" MinWidth="{StaticResource ScrollBarSize}" IsTabStop="False" Interval="50" Margin="{ThemeResource ScrollBarVerticalDecreaseMargin}" Grid.Row="0" Template="{StaticResource VerticalDecrementTemplate}" HorizontalAlignment="Center" />
<RepeatButton x:Name="VerticalLargeDecrease" Opacity="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Height="0" IsTabStop="False" Interval="50" Grid.Row="1" AllowFocusOnInteraction="False" Template="{StaticResource RepeatButtonTemplate}" />
<Thumb x:Name="VerticalThumb"
Opacity="0"
Expand All @@ -739,7 +744,7 @@
</Thumb>

<RepeatButton x:Name="VerticalLargeIncrease" Opacity="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsTabStop="False" Interval="50" Grid.Row="3" AllowFocusOnInteraction="False" Template="{StaticResource RepeatButtonTemplate}" />
<RepeatButton x:Name="VerticalSmallIncrease" Opacity="0" Height="{StaticResource ScrollBarSize}" MinWidth="{StaticResource ScrollBarSize}" IsTabStop="False" Interval="50" Margin="0" Grid.Row="4" Template="{StaticResource VerticalIncrementTemplate}" HorizontalAlignment="Center" />
<RepeatButton x:Name="VerticalSmallIncrease" Opacity="0" Height="{StaticResource ScrollBarSize}" MinWidth="{StaticResource ScrollBarSize}" IsTabStop="False" Interval="50" Margin="{ThemeResource ScrollBarVerticalIncreaseMargin}" Grid.Row="4" Template="{StaticResource VerticalIncrementTemplate}" HorizontalAlignment="Center" />
</Grid>
<Grid x:Name="VerticalPanningRoot" MinHeight="24" Visibility="Collapsed" Opacity="0" contract7Present:CornerRadius="{TemplateBinding CornerRadius}">
<Border x:Name="VerticalPanningThumb" VerticalAlignment="Top" HorizontalAlignment="Right" Background="{ThemeResource ScrollBarPanningThumbBackground}" BorderThickness="0" Width="2" MinHeight="32" Margin="2,0,2,0" />
Expand Down
2 changes: 1 addition & 1 deletion dev/TreeView/APITests/TreeViewTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public void VerifyVisualTree()
TreeView treeView = null;
RunOnUIThread.Execute(() =>
{
treeView = new TreeView() { Width = 400, Height = 400 };
treeView = new TreeView() { Width = 400, Height = 300 };
var node1 = new TreeViewNode() { Content = "Node1" };
treeView.RootNodes.Add(node1);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3935,7 +3935,7 @@
Width=12
Name=HorizontalSmallDecrease
MinHeight=12
Margin=0,0,0,0
Margin=1,0,0,0
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
Expand Down Expand Up @@ -4000,7 +4000,7 @@
Width=12
Name=HorizontalSmallIncrease
MinHeight=12
Margin=0,0,0,0
Margin=0,0,1,0
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
FocusVisualPrimaryThickness=2,2,2,2
Expand Down Expand Up @@ -4071,7 +4071,7 @@
CornerRadius=4,4,4,4
Name=VerticalSmallDecrease
MinWidth=12
Margin=0,0,0,0
Margin=0,1,0,0
Height=12
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
Expand Down Expand Up @@ -4198,7 +4198,7 @@
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=12,7
RenderSize=12,5
[Windows.UI.Xaml.Controls.Grid]
Padding=0,0,0,0
CornerRadius=0,0,0,0
Expand All @@ -4212,7 +4212,7 @@
FocusVisualPrimaryThickness=2,2,2,2
FocusVisualPrimaryBrush=#E4000000
Visibility=Visible
RenderSize=12,7
RenderSize=12,5
[Windows.UI.Xaml.Controls.Primitives.RepeatButton]
Padding=11,5,11,6
Foreground=#E4000000
Expand All @@ -4222,7 +4222,7 @@
CornerRadius=4,4,4,4
Name=VerticalSmallIncrease
MinWidth=12
Margin=0,0,0,0
Margin=0,0,0,1
Height=12
FocusVisualSecondaryThickness=1,1,1,1
FocusVisualSecondaryBrush=#B3FFFFFF
Expand Down