-
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.
Merge pull request #2270 from unoplatform/dev/cdb/bugs/layouter-min-size
Remove "min size" constrains to available size in layouter
- Loading branch information
Showing
6 changed files
with
187 additions
and
10 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
111 changes: 111 additions & 0 deletions
111
...SamplesApp/UITests.Shared/Windows_UI_Xaml/UIElementTests/UIElement_Layout_Constrains.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,111 @@ | ||
<Page | ||
x:Class="UITests.Shared.Windows_UI_Xaml.UIElementTests.UIElement_Layout_Constrains" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:toolkit="using:Uno.UI.Toolkit" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<ScrollViewer> | ||
<StackPanel Spacing="12" toolkit:VisibleBoundsPadding.PaddingMask="All"> | ||
<TextBlock FontSize="18">Following controls should be of same look:</TextBlock> | ||
|
||
<Border Height="40" Background="Aquamarine"> | ||
|
||
<StackPanel Orientation="Horizontal" Spacing="10"> | ||
<Button Width="80" VerticalAlignment="Stretch" Padding="5">BUTTON</Button> | ||
<Button Width="80" Height="60" VerticalAlignment="Center" Padding="5">BUTTON</Button> | ||
<Button Width="80" Height="80" Padding="5">BUTTON</Button> | ||
</StackPanel> | ||
</Border> | ||
|
||
<TextBlock FontSize="18">Following controls should be of same look:</TextBlock> | ||
|
||
<Border Background="Orange" Height="28"> | ||
<StackPanel Orientation="Horizontal" Spacing="10"> | ||
<Button Width="65" Padding="0" VerticalAlignment="Stretch"> | ||
<Border BorderThickness="2" BorderBrush="Blue"> | ||
<TextBlock FontSize="8" Padding="0"> | ||
BUTTON | ||
</TextBlock> | ||
</Border> | ||
</Button> | ||
<Button Width="65" Padding="0" Height="36"> | ||
<Border BorderThickness="2" BorderBrush="Blue"> | ||
<TextBlock FontSize="8" Padding="0"> | ||
BUTTON | ||
</TextBlock> | ||
</Border> | ||
</Button> | ||
<Button Width="65" Padding="0" Height="36" VerticalAlignment="Center"> | ||
<Border BorderThickness="2" BorderBrush="Blue"> | ||
<TextBlock FontSize="8" Padding="0"> | ||
BUTTON | ||
</TextBlock> | ||
</Border> | ||
</Button> | ||
</StackPanel> | ||
</Border> | ||
|
||
<Grid ColumnSpacing="10"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<Rectangle Width="100" HorizontalAlignment="Left" Fill="DarkSeaGreen"></Rectangle> | ||
<StackPanel Spacing="3"> | ||
<TextBlock>green width is 100</TextBlock> | ||
<Border BorderBrush="Blue" BorderThickness="2" HorizontalAlignment="Left" MaxWidth="100"> | ||
<TextBlock>Max=100</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" HorizontalAlignment="Left" MaxWidth="100"> | ||
<TextBlock TextWrapping="NoWrap">Max=100 + very long text</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" HorizontalAlignment="Left" MaxWidth="40" MinWidth="80"> | ||
<TextBlock TextWrapping="NoWrap">Max=40<LineBreak />Min=80</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" HorizontalAlignment="Left" Width="100"> | ||
<TextBlock>Width=100</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" HorizontalAlignment="Left" MinWidth="80" MaxWidth="120"> | ||
<TextBlock>min/max<LineBreak />80/120</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" HorizontalAlignment="Left" MinWidth="80" MaxWidth="40"> | ||
<TextBlock>min/max<LineBreak />80/40</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" HorizontalAlignment="Left" MinWidth="80" MaxWidth="120"> | ||
<TextBlock TextWrapping="NoWrap">min/max<LineBreak />80/120 + very very very long text</TextBlock> | ||
</Border> | ||
</StackPanel> | ||
<Rectangle Height="100" VerticalAlignment="Top" Fill="LightPink" Grid.Column="1"></Rectangle> | ||
<StackPanel Orientation="Horizontal" Grid.Column="1" Spacing="3"> | ||
<TextBlock>pink height is 100</TextBlock> | ||
<Border BorderBrush="Blue" BorderThickness="2" VerticalAlignment="Top" MaxHeight="100"> | ||
<TextBlock>MaxH=100<LineBreak />+<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />long<LineBreak />text</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" VerticalAlignment="Top" MaxHeight="100"> | ||
<TextBlock>MaxH=100</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" VerticalAlignment="Top" MaxHeight="10" MinHeight="50"> | ||
<TextBlock>MaxH=100, MinH=50<LineBreak />+<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />long<LineBreak />text</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" VerticalAlignment="Top" Height="100"> | ||
<TextBlock>H=100</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" VerticalAlignment="Top" MinHeight="80" MaxHeight="120"> | ||
<TextBlock>min/max<LineBreak />80/120</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" VerticalAlignment="Top" MinHeight="80" MaxHeight="40"> | ||
<TextBlock>min/max<LineBreak />80/40</TextBlock> | ||
</Border> | ||
<Border BorderBrush="Blue" BorderThickness="2" VerticalAlignment="Top" MinHeight="80" MaxHeight="120"> | ||
<TextBlock>min/max<LineBreak />80/120<LineBreak />+<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />very<LineBreak />long<LineBreak />text</TextBlock> | ||
</Border> | ||
</StackPanel> | ||
</Grid> | ||
|
||
</StackPanel> | ||
</ScrollViewer> | ||
</Page> |
14 changes: 14 additions & 0 deletions
14
...plesApp/UITests.Shared/Windows_UI_Xaml/UIElementTests/UIElement_Layout_Constrains.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,14 @@ | ||
using Windows.UI.Xaml.Controls; | ||
using Uno.UI.Samples.Controls; | ||
|
||
namespace UITests.Shared.Windows_UI_Xaml.UIElementTests | ||
{ | ||
[SampleControlInfo("UIElement")] | ||
public sealed partial class UIElement_Layout_Constrains : Page | ||
{ | ||
public UIElement_Layout_Constrains() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
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