Skip to content

Commit

Permalink
fix: TextBox Outlined style inconsistencies (#1335)
Browse files Browse the repository at this point in the history
  • Loading branch information
silviuo committed Jan 29, 2024
1 parent d380d7d commit e3812da
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/library/Uno.Material/Styles/Controls/v2/TextBox.xaml
Expand Up @@ -23,7 +23,7 @@
<StaticResource x:Key="TextBoxDeleteButtonForegroundPressed" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="TextBoxDeleteButtonForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<!--#endregion-->

<!--#region Leading Icon Brushes-->
<StaticResource x:Key="TextBoxLeadingIconForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="TextBoxLeadingIconForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
Expand Down Expand Up @@ -122,7 +122,7 @@
<StaticResource x:Key="TextBoxDeleteButtonForegroundPressed" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="TextBoxDeleteButtonForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
<!--#endregion-->

<!--#region Leading Icon Brushes-->
<StaticResource x:Key="TextBoxLeadingIconForeground" ResourceKey="OnSurfaceVariantBrush" />
<StaticResource x:Key="TextBoxLeadingIconForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
Expand Down Expand Up @@ -613,16 +613,18 @@

<!-- Border in place to properly vertically center the icon inside when it's a one-line TextBox -->
<!-- but keep it in the same place and at the top when it's a multiline TextBox -->
<Border Height="20"
VerticalAlignment="Top">
<Border Height="26"
VerticalAlignment="Top"
Visibility="{Binding Path=(um:ControlExtensions.Icon), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource MaterialNullToCollapsedConverter}, FallbackValue=Collapsed, TargetNullValue=Collapsed}">
<ContentPresenter x:Name="IconPresenter"
Content="{Binding Path=(um:ControlExtensions.Icon), RelativeSource={RelativeSource TemplatedParent}}"
HorizontalAlignment="Center"
Width="20"
Margin="1,0,18,0"
MinWidth="25"
MaxWidth="34"
MaxHeight="34"
Margin="0,0,8,0"
Foreground="{ThemeResource TextBoxLeadingIconForeground}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Visibility="{Binding Path=(um:ControlExtensions.Icon), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource MaterialNullToCollapsedConverter}, FallbackValue=Collapsed, TargetNullValue=Collapsed}" />
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>

<ScrollViewer x:Name="ContentElement"
Expand All @@ -646,7 +648,7 @@
<!-- Border in place to properly vertically center the placeholder inside when it's a one-line TextBox -->
<!-- but keep it in the same place and at the top when it's a multiline TextBox -->
<Border Grid.Column="1"
Height="20"
Height="26"
VerticalAlignment="Top">
<TextBlock x:Name="PlaceholderElement"
Foreground="{Binding PlaceholderForeground, RelativeSource={RelativeSource TemplatedParent}}"
Expand Down

0 comments on commit e3812da

Please sign in to comment.