-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(commandbarrenderer): Fix CommandBarRenderer Height for iOS
- Loading branch information
1 parent
0033663
commit 28cc1b6
Showing
3 changed files
with
151 additions
and
136 deletions.
There are no files selected for viewing
274 changes: 147 additions & 127 deletions
274
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/CommandBar/CommandBar_Dynamic.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 |
---|---|---|
@@ -1,162 +1,182 @@ | ||
<UserControl x:Class="Uno.UI.Samples.Content.UITests.CommandBar.CommandBar_Dynamic" | ||
<Page x:Class="Uno.UI.Samples.Content.UITests.CommandBar.CommandBar_Dynamic" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.UI.Samples.Content.UITests.CommandBar" | ||
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" | ||
xmlns:button="clr-namespace:UITests.Shared.Windows_UI_Xaml_Controls.Button" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<UserControl.Resources> | ||
<UserControl.Resources> | ||
|
||
<DataTemplate x:Key="ColorDataTemplate"> | ||
<Border Height="20"> | ||
<Border.Background> | ||
<SolidColorBrush Color="{Binding}" /> | ||
</Border.Background> | ||
</Border> | ||
</DataTemplate> | ||
<DataTemplate x:Key="ColorDataTemplate"> | ||
<Border Height="20"> | ||
<Border.Background> | ||
<SolidColorBrush Color="{Binding}" /> | ||
</Border.Background> | ||
</Border> | ||
</DataTemplate> | ||
|
||
</UserControl.Resources> | ||
<Style TargetType="Slider"> | ||
<Setter Property="Maximum" Value="1" /> | ||
<Setter Property="StepFrequency" Value="0.05" /> | ||
</Style> | ||
|
||
<Grid> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<CommandBar Content="{Binding Text, ElementName=Content2}" | ||
<button:FromNullableBoolToCustomValueConverter | ||
x:Key="nativeTemplateConverter" | ||
TrueValue="{StaticResource NativeDefaultCommandBar}" | ||
NullOrFalseValue="{StaticResource XamlDefaultCommandBar}"/> | ||
|
||
</UserControl.Resources> | ||
|
||
<Grid toolkit:VisibleBoundsPadding.PaddingMask="All"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="*" /> | ||
</Grid.RowDefinitions> | ||
<CommandBar Content="{Binding Text, ElementName=Content2}" | ||
Visibility="{Binding Text, ElementName=cbVisibility}" | ||
Opacity="{Binding Value, ElementName=sliderOpacity}"> | ||
<CommandBar.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
Opacity="{Binding Value, ElementName=sliderOpacity}" | ||
Style="{Binding IsChecked, ElementName=native, Converter={StaticResource nativeTemplateConverter}}"> | ||
<CommandBar.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
Opacity="{Binding Value, ElementName=ForegroundOpacity}" /> | ||
</CommandBar.Foreground> | ||
<CommandBar.Background> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=BackgroundColor}" | ||
</CommandBar.Foreground> | ||
<CommandBar.Background> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=BackgroundColor}" | ||
Opacity="{Binding Value, ElementName=BackgroundOpacity}" /> | ||
</CommandBar.Background> | ||
<toolkit:CommandBarExtensions.NavigationCommand> | ||
<AppBarButton Label="{Binding Text, ElementName=CommandLabel}" | ||
</CommandBar.Background> | ||
<toolkit:CommandBarExtensions.NavigationCommand> | ||
<AppBarButton Label="{Binding Text, ElementName=CommandLabel}" | ||
Visibility="{Binding SelectedItem, ElementName=CommandVisibility}" | ||
IsEnabled="{Binding SelectedItem, ElementName=CommandIsEnabled}" | ||
Opacity="{Binding Value, ElementName=CommandOpacity}"> | ||
<AppBarButton.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
<AppBarButton.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
Opacity="{Binding Value, ElementName=ForegroundOpacity}" /> | ||
</AppBarButton.Foreground> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/Icons/menu.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</toolkit:CommandBarExtensions.NavigationCommand> | ||
<CommandBar.PrimaryCommands> | ||
<AppBarButton Content="{Binding Text, ElementName=Content2}" | ||
</AppBarButton.Foreground> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="ms-appx:///Assets/Icons/menu.png" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</toolkit:CommandBarExtensions.NavigationCommand> | ||
<CommandBar.PrimaryCommands> | ||
<AppBarButton Content="{Binding Text, ElementName=Content2}" | ||
Label="{Binding Text, ElementName=CommandLabel}" | ||
Visibility="{Binding SelectedItem, ElementName=CommandVisibility}" | ||
IsEnabled="{Binding SelectedItem, ElementName=CommandIsEnabled}" | ||
Opacity="{Binding Value, ElementName=CommandOpacity}"> | ||
<AppBarButton.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
<AppBarButton.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
Opacity="{Binding Value, ElementName=ForegroundOpacity}" /> | ||
</AppBarButton.Foreground> | ||
</AppBarButton> | ||
<AppBarButton Content="{Binding Text, ElementName=Content2}" | ||
</AppBarButton.Foreground> | ||
</AppBarButton> | ||
<AppBarButton Content="{Binding Text, ElementName=Content2}" | ||
Label="{Binding Text, ElementName=CommandLabel}" | ||
Visibility="{Binding SelectedItem, ElementName=CommandVisibility}" | ||
IsEnabled="{Binding SelectedItem, ElementName=CommandIsEnabled}" | ||
Opacity="{Binding Value, ElementName=CommandOpacity}"> | ||
<AppBarButton.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
<AppBarButton.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
Opacity="{Binding Value, ElementName=ForegroundOpacity}" /> | ||
</AppBarButton.Foreground> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="{Binding Text, ElementName=CommandIcon}" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</CommandBar.PrimaryCommands> | ||
<CommandBar.SecondaryCommands> | ||
<AppBarButton Content="{Binding Text, ElementName=Content2}" | ||
</AppBarButton.Foreground> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="{Binding Text, ElementName=CommandIcon}" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</CommandBar.PrimaryCommands> | ||
<CommandBar.SecondaryCommands> | ||
<AppBarButton Content="{Binding Text, ElementName=Content2}" | ||
Label="{Binding Text, ElementName=CommandLabel}" | ||
Visibility="{Binding SelectedItem, ElementName=CommandVisibility}" | ||
IsEnabled="{Binding SelectedItem, ElementName=CommandIsEnabled}" | ||
Opacity="{Binding Value, ElementName=sliderOpacity}"> | ||
<AppBarButton.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
<AppBarButton.Foreground> | ||
<SolidColorBrush Color="{Binding SelectedItem, ElementName=ForegroundColor}" | ||
Opacity="{Binding Value, ElementName=ForegroundOpacity}" /> | ||
</AppBarButton.Foreground> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="{Binding Text, ElementName=CommandIcon}" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</CommandBar.SecondaryCommands> | ||
</CommandBar> | ||
<ScrollViewer Grid.Row="1"> | ||
<StackPanel> | ||
<ComboBox x:Name="cbVisibility" | ||
Header="Visibility" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" /> | ||
<Slider Style="{StaticResource XamlDefaultSlider}" | ||
x:Name="sliderOpacity" | ||
Header="Opacity" | ||
Value="1" | ||
Minimum="0" | ||
Maximum="1" /> | ||
<TextBox Style="{StaticResource XamlDefaultTextBox}" | ||
HorizontalAlignment="Stretch" | ||
x:Name="Content2" | ||
Header="Content" | ||
Text="Content" /> | ||
<ComboBox x:Name="BackgroundColor" | ||
Header="BackgroundColor" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" | ||
ItemTemplate="{StaticResource ColorDataTemplate}" /> | ||
<Slider Style="{StaticResource XamlDefaultSlider}" | ||
x:Name="BackgroundOpacity" | ||
Header="BackgroundOpacity" | ||
Value="1" | ||
Minimum="0" | ||
Maximum="1"/> | ||
<ComboBox x:Name="ForegroundColor" | ||
Header="ForegroundColor" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" | ||
ItemTemplate="{StaticResource ColorDataTemplate}" /> | ||
<Slider Style="{StaticResource XamlDefaultSlider}" | ||
x:Name="ForegroundOpacity" | ||
Header="ForegroundOpacity" | ||
Value="1" | ||
Minimum="0" | ||
Maximum="1" /> | ||
<ComboBox x:Name="CommandVisibility" | ||
Header="CommandVisibility" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" /> | ||
<Slider Style="{StaticResource XamlDefaultSlider}" | ||
x:Name="CommandOpacity" | ||
Header="CommandOpacity" | ||
Value="1" | ||
Minimum="0" | ||
Maximum="1" /> | ||
<ComboBox x:Name="CommandIsEnabled" | ||
Header="CommandIsEnabled" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" /> | ||
<TextBox Style="{StaticResource XamlDefaultTextBox}" | ||
x:Name="CommandIcon" | ||
Header="CommandIcon" | ||
HorizontalAlignment="Stretch" | ||
Text="ms-appx:///Assets/Icons/search.png" /> | ||
<TextBox Style="{StaticResource XamlDefaultTextBox}" | ||
x:Name="CommandLabel" | ||
Header="CommandLabel" | ||
HorizontalAlignment="Stretch" | ||
Text="Label" /> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</Grid> | ||
</AppBarButton.Foreground> | ||
<AppBarButton.Icon> | ||
<BitmapIcon UriSource="{Binding Text, ElementName=CommandIcon}" /> | ||
</AppBarButton.Icon> | ||
</AppBarButton> | ||
</CommandBar.SecondaryCommands> | ||
</CommandBar> | ||
<ScrollViewer Grid.Row="1"> | ||
<StackPanel Spacing="8" Margin="30,0"> | ||
<CheckBox x:Name="native" Content="NativeCommandBar" IsChecked="True" /> | ||
<ComboBox x:Name="cbVisibility" | ||
Header="Visibility" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" /> | ||
<Slider | ||
x:Name="sliderOpacity" | ||
Header="Opacity" | ||
Value="1" /> | ||
<TextBox Style="{StaticResource XamlDefaultTextBox}" | ||
HorizontalAlignment="Stretch" | ||
x:Name="Content2" | ||
Header="Content" | ||
Text="Content" /> | ||
<ComboBox x:Name="BackgroundColor" | ||
Header="BackgroundColor" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" | ||
ItemTemplate="{StaticResource ColorDataTemplate}" /> | ||
<Slider | ||
x:Name="BackgroundOpacity" | ||
Header="BackgroundOpacity" | ||
Value="1"/> | ||
<ComboBox x:Name="ForegroundColor" | ||
Header="ForegroundColor" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" | ||
ItemTemplate="{StaticResource ColorDataTemplate}" /> | ||
<Slider | ||
x:Name="ForegroundOpacity" | ||
Header="ForegroundOpacity" | ||
Value="1"/> | ||
<ComboBox x:Name="CommandVisibility" | ||
Header="CommandVisibility" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" /> | ||
<Slider | ||
x:Name="CommandOpacity" | ||
Header="CommandOpacity" | ||
Value="1" /> | ||
<ComboBox | ||
x:Name="CommandIsEnabled" | ||
Header="CommandIsEnabled" | ||
HorizontalAlignment="Stretch" | ||
Style="{StaticResource XamlDefaultComboBox}" /> | ||
<TextBox Style="{StaticResource XamlDefaultTextBox}" | ||
x:Name="CommandIcon" | ||
Header="CommandIcon" | ||
HorizontalAlignment="Stretch" | ||
Text="ms-appx:///Assets/Icons/search.png" /> | ||
<TextBox Style="{StaticResource XamlDefaultTextBox}" | ||
x:Name="CommandLabel" | ||
Header="CommandLabel" | ||
HorizontalAlignment="Stretch" | ||
Text="Label" /> | ||
</StackPanel> | ||
</ScrollViewer> | ||
<StackPanel Grid.RowSpan="2" IsHitTestVisible="False" Orientation="Horizontal" Width="200"> | ||
<Border Background="#80ff8000" Height="30" BorderBrush="Black" BorderThickness="1" VerticalAlignment="Top"> | ||
<TextBlock Text="30 px" FontWeight="Bold" /> | ||
</Border> | ||
<Border Background="#80ffff00" Height="40" BorderBrush="Black" BorderThickness="1" VerticalAlignment="Top"> | ||
<TextBlock Text="40 px" FontWeight="Bold" /> | ||
</Border> | ||
<Border Background="#80ff8000" Height="50" BorderBrush="Black" BorderThickness="1" VerticalAlignment="Top"> | ||
<TextBlock Text="50 px" FontWeight="Bold" /> | ||
</Border> | ||
<Border Background="#80ffff00" Height="60" BorderBrush="Black" BorderThickness="1" VerticalAlignment="Top"> | ||
<TextBlock Text="60 px" FontWeight="Bold" /> | ||
</Border> | ||
</StackPanel> | ||
</Grid> | ||
|
||
</UserControl> | ||
</Page> |
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