-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ScrollViewer): Content margin was not taken into consideration fo…
…r Skia and WASM. (Note for WASM; bottom or right margin in ScrollViewer cannot be scrolled to the end still need to be fixed with issue #7000)
- Loading branch information
Agnès Zitte
committed
Mar 24, 2022
1 parent
6c721b1
commit 0d201d4
Showing
16 changed files
with
243 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ITests.Shared/Windows_UI_Xaml_Controls/ScrollViewerTests/ScrollViewer_Content_Margin.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<UserControl x:Class="UITests.Windows_UI_Xaml_Controls.ScrollViewerTests.ScrollViewer_Content_Margin" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml_Controls.ScrollViewerTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<StackPanel Spacing="10" | ||
HorizontalAlignment="Center"> | ||
|
||
<Button x:Name="ScrollToRightBottomButton" | ||
Content="Scroll to Right | Bottom" | ||
Click="ScrollToRightBottomButton_Click" /> | ||
|
||
<Border x:Name="OuterBorder" | ||
Background="LightBlue"> | ||
|
||
<ScrollViewer x:Name="BothDirectionsScrollViewer" | ||
Width="300" | ||
Height="300" | ||
VerticalScrollMode="Enabled" | ||
VerticalScrollBarVisibility="Auto" | ||
HorizontalScrollMode="Enabled" | ||
HorizontalScrollBarVisibility="Auto"> | ||
<Border Width="500" | ||
Height="500" | ||
Margin="100" | ||
Background="Pink" | ||
BorderBrush="Red" | ||
BorderThickness="10" /> | ||
</ScrollViewer> | ||
|
||
</Border> | ||
|
||
<TextBlock x:Name="ChildStatusTextBlock" | ||
Text="Unscrolled" /> | ||
</StackPanel> | ||
</UserControl> |
33 changes: 33 additions & 0 deletions
33
...sts.Shared/Windows_UI_Xaml_Controls/ScrollViewerTests/ScrollViewer_Content_Margin.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace UITests.Windows_UI_Xaml_Controls.ScrollViewerTests | ||
{ | ||
[Sample("ScrollViewer")] | ||
public sealed partial class ScrollViewer_Content_Margin : UserControl | ||
{ | ||
public ScrollViewer_Content_Margin() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
|
||
private void ScrollToRightBottomButton_Click(object sender, object args) | ||
{ | ||
BothDirectionsScrollViewer.ChangeView(500, 500, null, disableAnimation: true); | ||
ChildStatusTextBlock.Text = "Scrolled"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.