fix(ui): text and password boxes pad their text once; shared password error state
- The text box hands its Padding to the content host itself; the template no longer adds it again, so typed text starts where the placeholder does (12 px, 8 px after a leading icon). Same for the password box. - ui:Field.Error marks an input without a validating binding (a password box) with the error border and makes the sentence its help text; the Uploader and the login dialog use it instead of drawing their own. - The brand mark keeps its orientation by itself; the local left-to-right settings are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
8 files changed
+52
-30
No files matched your search
@@ -136,8 +136,7 @@
|
||||
<!-- First run / signed out: connect form. -->
|
||||
<Grid Grid.Row="1" Visibility="{Binding IsConnectVisible, Converter={StaticResource BoolToVisibility}}">
|
||||
<StackPanel DataContext="{Binding Connect}" Width="440" HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<!-- The mark is artwork: its off-centre sun must not flip in right-to-left languages. -->
|
||||
<ui:BrandMarkIcon Width="48" Height="48" HorizontalAlignment="Center" FlowDirection="LeftToRight" />
|
||||
<ui:BrandMarkIcon Width="48" Height="48" HorizontalAlignment="Center" />
|
||||
<TextBlock Text="{l:Loc Uploader.Connect.Title}" Style="{StaticResource Text.Title}" HorizontalAlignment="Center" Margin="0,14,0,20" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -188,15 +187,9 @@
|
||||
ToolTip="{l:Loc Tooltips.Uploader.User}" AutomationProperties.Name="{l:Loc Uploader.Connect.User}" />
|
||||
|
||||
<TextBlock Grid.Row="3" Text="{l:Loc Uploader.Connect.Password}" Style="{StaticResource Text.Label}" Margin="0,12,12,0" />
|
||||
<!-- A wrong password: the kit's error border (DESIGN §4); the message is the tooltip. -->
|
||||
<PasswordBox x:Name="Password" Grid.Row="3" Grid.Column="1" Margin="0,12,0,0" PasswordChanged="OnPasswordChanged"
|
||||
ToolTip="{Binding PasswordToolTip}" AutomationProperties.Name="{l:Loc Uploader.Connect.Password}" />
|
||||
<!--
|
||||
A wrong password: the Error border (DESIGN §4), drawn over the box because the password box has no binding
|
||||
to validate and its template paints the focus border over its own; the message is the tooltip.
|
||||
-->
|
||||
<Border x:Name="PasswordErrorRing" Grid.Row="3" Grid.Column="1" Margin="0,12,0,0" BorderBrush="{DynamicResource Brush.Error}" BorderThickness="1"
|
||||
CornerRadius="{StaticResource Radius.Control}" SnapsToDevicePixels="True" IsHitTestVisible="False"
|
||||
Visibility="{Binding PasswordError, Converter={x:Static ui:NullToCollapsedConverter.Instance}}" />
|
||||
ToolTip="{Binding PasswordToolTip}" AutomationProperties.Name="{l:Loc Uploader.Connect.Password}" ui:Field.Error="{Binding PasswordError}" />
|
||||
|
||||
<Border Grid.Row="4" Grid.Column="1" Margin="0,12,0,0" Padding="10,6,6,6" CornerRadius="{StaticResource Radius.Control}" Background="{DynamicResource Brush.ErrorSubtle}"
|
||||
Visibility="{Binding ErrorText, Converter={x:Static ui:NullToCollapsedConverter.Instance}}">
|
||||
|
||||
Reference in new issue
Block a user