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
@@ -9,8 +9,7 @@
|
||||
<Border Style="{StaticResource Border.Panel}" Padding="28,24" HorizontalAlignment="Left" VerticalAlignment="Top" MinWidth="600">
|
||||
<StackPanel>
|
||||
<StackPanel Orientation="Horizontal" Margin="0,0,0,22">
|
||||
<!-- The mark keeps its clockwise ring and its sun on the right in every reading direction. -->
|
||||
<ui:BrandMarkIcon Width="56" Height="56" ShowPlate="True" FlowDirection="LeftToRight" />
|
||||
<ui:BrandMarkIcon Width="56" Height="56" ShowPlate="True" />
|
||||
<StackPanel Margin="16,0,0,0" VerticalAlignment="Center">
|
||||
<TextBlock Text="{l:Loc Shell.AppName}" Style="{StaticResource Text.PageTitle}" FontSize="22" />
|
||||
<TextBlock Text="{Binding Version}" Style="{StaticResource Text.Secondary}" Margin="0,2,0,0" Typography.NumeralAlignment="Tabular" />
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<DockPanel LastChildFill="True">
|
||||
<ComboBox DockPanel.Dock="Right" VerticalAlignment="Top" MinWidth="120" ItemsSource="{Binding Languages}" SelectedItem="{Binding SelectedLanguage}"
|
||||
DisplayMemberPath="Name" ToolTip="{l:Loc Tooltips.Welcome.Language}" AutomationProperties.Name="{l:Loc Settings.General.Language}" />
|
||||
<ui:BrandMarkIcon Width="56" Height="56" ShowPlate="True" FlowDirection="LeftToRight" />
|
||||
<ui:BrandMarkIcon Width="56" Height="56" ShowPlate="True" />
|
||||
<StackPanel Margin="16,0,16,0" VerticalAlignment="Center">
|
||||
<TextBlock Text="{l:Loc Shell.Welcome.Title}" FontSize="20" FontWeight="SemiBold" TextTrimming="CharacterEllipsis" />
|
||||
<TextBlock Text="{l:Loc Shell.Welcome.Question}" Foreground="{DynamicResource Brush.TextMuted}" Margin="0,4,0,0" TextTrimming="CharacterEllipsis" />
|
||||
|
||||
@@ -8,7 +8,8 @@ namespace Titano.App.Shell;
|
||||
/// <summary>
|
||||
/// The login form (BRIEF §12.7). It calls back the connection with the credentials and stays open with the
|
||||
/// error sentence until the sign-in succeeds or the user cancels. The password never leaves the PasswordBox
|
||||
/// except for that call. A failed sign-in is announced to screen readers and stays as the password box's help text.
|
||||
/// except for that call. A failed sign-in is announced to screen readers and marks the password box (error border,
|
||||
/// sentence as its help text) until the next attempt.
|
||||
/// </summary>
|
||||
public sealed partial class LoginDialog : TitanoWindow
|
||||
{
|
||||
@@ -42,7 +43,7 @@ public sealed partial class LoginDialog : TitanoWindow
|
||||
{
|
||||
SignIn.IsEnabled = false;
|
||||
Error.Visibility = Visibility.Collapsed;
|
||||
AutomationProperties.SetHelpText(Password, string.Empty);
|
||||
Field.SetError(Password, null);
|
||||
try
|
||||
{
|
||||
var error = await _signIn(User.Text, Password.Password);
|
||||
@@ -53,7 +54,7 @@ public sealed partial class LoginDialog : TitanoWindow
|
||||
}
|
||||
Error.Text = error;
|
||||
Error.Visibility = Visibility.Visible;
|
||||
AutomationProperties.SetHelpText(Password, error);
|
||||
Field.SetError(Password, error);
|
||||
Password.Clear();
|
||||
Password.Focus();
|
||||
UIElementAutomationPeer.CreatePeerForElement(this)?.RaiseNotificationEvent(
|
||||
|
||||
Reference in new issue
Block a user