Skip to content

Commit

Permalink
chore: updating markup and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunal22shah committed Oct 30, 2024
1 parent ee096dc commit 94e694e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 26 deletions.
5 changes: 1 addition & 4 deletions doc/styles/PasswordBox.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ IsDefaultStyle\*: Styles in this column will be set as the default implicit styl
| `OutlinedPasswordBoxCharacterSpacing` | `Int32` | `BodyLargeCharacterSpacing` |
| `OutlinedPasswordBoxCornerRadius` | `CornerRadius` | 4 |
| `OutlinedPasswordBoxMinHeight` | `Double` | 58 |
| `OutlinedPasswordBoxBorderPadding` | `Thickness` | 1 |
| `OutlinedPasswordBoxBorderPaddingPointerOver` | `Thickness` | 0 |
| `OutlinedPasswordBoxBorderPaddingFocused` | `Thickness` | 0 |
| `OutlinedPasswordBoxPadding` | `Thickness` | 16,4,8,4 |
| `OutlinedPasswordBoxBorderThickness` | `Thickness` | 1 |
| `OutlinedPasswordBoxBorderThicknessPointerOver` | `Thickness` | 2 |
| `OutlinedPasswordBoxBorderThicknessPointerOver` | `Thickness` | 1 |
| `OutlinedPasswordBoxBorderThicknessFocused` | `Thickness` | 2 |
17 changes: 7 additions & 10 deletions src/library/Uno.Material/Styles/Controls/v2/PasswordBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,10 @@

<CornerRadius x:Key="OutlinedPasswordBoxCornerRadius">4</CornerRadius>
<x:Double x:Key="OutlinedPasswordBoxMinHeight">58</x:Double>
<Thickness x:Key="OutlinedPasswordBoxBorderPadding">1</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderThickness">1</Thickness>
<Thickness x:Key="OutlinedPasswordBoxPadding">16,4,8,4</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderThicknessPointerOver">1</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderPaddingPointerOver">1</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderThicknessFocused">2</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderPaddingFocused">1</Thickness>

<CornerRadius x:Key="FilledPasswordBoxCornerRadius">4,4,0,0</CornerRadius>
<x:Double x:Key="FilledPasswordBoxMinHeight">56</x:Double>
Expand Down Expand Up @@ -183,13 +180,10 @@

<CornerRadius x:Key="OutlinedPasswordBoxCornerRadius">4</CornerRadius>
<x:Double x:Key="OutlinedPasswordBoxMinHeight">58</x:Double>
<Thickness x:Key="OutlinedPasswordBoxBorderPadding">1</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderThickness">1</Thickness>
<Thickness x:Key="OutlinedPasswordBoxPadding">16,4,8,4</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderThicknessPointerOver">1</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderPaddingPointerOver">1</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderThicknessFocused">2</Thickness>
<Thickness x:Key="OutlinedPasswordBoxBorderPaddingFocused">1</Thickness>

<CornerRadius x:Key="FilledPasswordBoxCornerRadius">4,4,0,0</CornerRadius>
<x:Double x:Key="FilledPasswordBoxMinHeight">56</x:Double>
Expand Down Expand Up @@ -478,35 +472,35 @@

<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource OutlinedPasswordBoxBorderBrushPointerOver}" />
<Setter Target="ContentElement.Foreground" Value="{ThemeResource OutlinedPasswordBoxForegroundPointerOver}" />
<Setter Target="PlaceholderElement.Foreground" Value="{ThemeResource OutlinedPasswordBoxPlaceholderForegroundPointerOver}" />
<Setter Target="Root.Background" Value="{ThemeResource OutlinedPasswordBoxBackgroundPointerOver}" />
<Setter Target="BorderBorder.BorderThickness" Value="{ThemeResource OutlinedPasswordBoxBorderThicknessPointerOver}" />
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource OutlinedPasswordBoxBorderBrushPointerOver}" />
</VisualState.Setters>
</VisualState>

<VisualState x:Name="Pressed" />

<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource OutlinedPasswordBoxBorderBrushDisabled}" />
<!-- In this case the opacity is not applied to the brush directly - known issue for ContentElement -->
<Setter Target="ContentElement.Foreground" Value="{ThemeResource OutlinedPasswordBoxForegroundDisabled}" />
<Setter Target="ContentElement.Opacity" Value="{ThemeResource OutlinedPasswordBoxForegroundOpacityDisabled}" />
<Setter Target="PlaceholderElement.Foreground" Value="{ThemeResource OutlinedPasswordBoxPlaceholderForegroundDisabled}" />
<Setter Target="Root.Background" Value="{ThemeResource OutlinedPasswordBoxBackgroundDisabled}" />
<Setter Target="IconPresenter.Foreground" Value="{ThemeResource PasswordBoxLeadingIconForegroundDisabled}" />
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource OutlinedPasswordBoxBorderBrushDisabled}" />
</VisualState.Setters>
</VisualState>

<VisualState x:Name="Focused">
<VisualState.Setters>
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource OutlinedPasswordBoxBorderBrushFocused}" />
<Setter Target="ContentElement.Foreground" Value="{ThemeResource OutlinedPasswordBoxForegroundFocused}" />
<Setter Target="PlaceholderElement.Foreground" Value="{ThemeResource OutlinedPasswordBoxPlaceholderForegroundFocused}" />
<Setter Target="Root.Background" Value="{ThemeResource OutlinedPasswordBoxBackgroundFocused}" />
<Setter Target="BorderBorder.BorderThickness" Value="{ThemeResource OutlinedPasswordBoxBorderThicknessFocused}" />
<Setter Target="BorderBorder.BorderBrush" Value="{ThemeResource OutlinedPasswordBoxBorderBrushFocused}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
Expand Down Expand Up @@ -628,7 +622,10 @@
Style="{StaticResource MaterialRevealButtonStyle}"
Visibility="Collapsed" />
</Grid>

<!--
In Figma design, border thickness doesn't push its inner content like on xaml.
So we are putting the border as an overlay here. To keep the rest of the measurements/values identical to Figma.
-->
<Border x:Name="BorderBorder"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Expand Down
12 changes: 0 additions & 12 deletions src/library/Uno.Themes.WinUI.Markup/Theme/PasswordBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,6 @@ public static partial class BorderBrush
public static ThemeResourceKey<Brush> Focused => new("OutlinedPasswordBoxBorderBrushFocused");
}

public static partial class BorderPadding
{
[ResourceKeyDefinition(typeof(Thickness), "OutlinedPasswordBoxBorderPadding")]
public static ThemeResourceKey<Thickness> Default => new("OutlinedPasswordBoxBorderPadding");

[ResourceKeyDefinition(typeof(Thickness), "OutlinedPasswordBoxBorderPaddingPointerOver")]
public static ThemeResourceKey<Thickness> PointerOver => new("OutlinedPasswordBoxBorderPaddingPointerOver");

[ResourceKeyDefinition(typeof(Thickness), "OutlinedPasswordBoxBorderPaddingFocused")]
public static ThemeResourceKey<Thickness> Focused => new("OutlinedPasswordBoxBorderPaddingFocused");
}

public static partial class BorderThickness
{
[ResourceKeyDefinition(typeof(Thickness), "OutlinedPasswordBoxBorderThickness")]
Expand Down

0 comments on commit 94e694e

Please sign in to comment.