refactor(textbox): Add the Lightweight Styling Text Box Style (#1002)
This commit is contained in:
Родитель
e7007d5b1a
Коммит
618fc2e442
|
@ -300,8 +300,8 @@
|
|||
<SolidColorBrush x:Key="OnSurfaceDraggedBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DraggedOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceSelectedBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource SelectedOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceMediumBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource MediumOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource LowOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource HoverOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledLowOpacity}" />
|
||||
<!--#endregion OnSurfaceColor-->
|
||||
<!--#region SurfaceVariantColor -->
|
||||
|
@ -666,8 +666,8 @@
|
|||
<SolidColorBrush x:Key="OnSurfaceDraggedBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DraggedOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceSelectedBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource SelectedOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceMediumBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource MediumOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource LowOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource HoverOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledLowOpacity}" />
|
||||
<!--#endregion OnSurfaceColor-->
|
||||
<!--#region SurfaceVariantColor -->
|
||||
|
@ -1033,8 +1033,8 @@
|
|||
<SolidColorBrush x:Key="OnSurfaceDraggedBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DraggedOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceSelectedBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource SelectedOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceMediumBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource MediumOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource LowOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource HoverOpacity}" />
|
||||
<SolidColorBrush x:Key="OnSurfaceDisabledLowBrush" Color="{StaticResource OnSurfaceColor}" Opacity="{StaticResource DisabledLowOpacity}" />
|
||||
<!--#endregion OnSurfaceColor-->
|
||||
<!--#region SurfaceVariantColor -->
|
||||
|
|
|
@ -13,17 +13,172 @@
|
|||
NullOrEmptyValue="0" />
|
||||
|
||||
<!-- Path Data -->
|
||||
<x:String x:Key="M3ClearGlyphPathData">M10 0C4.47 0 0 4.47 0 10C0 15.53 4.47 20 10 20C15.53 20 20 15.53 20 10C20 4.47 15.53 0 10 0ZM10 18C5.59 18 2 14.41 2 10C2 5.59 5.59 2 10 2C14.41 2 18 5.59 18 10C18 14.41 14.41 18 10 18ZM10 8.59L13.59 5L15 6.41L11.41 10L15 13.59L13.59 15L10 11.41L6.41 15L5 13.59L8.59 10L5 6.41L6.41 5L10 8.59Z</x:String>
|
||||
<x:String x:Key="MaterialTextBoxClearGlyphData">M14.9482 6.46442L13.534 5.05021L9.99849 8.58574L6.46296 5.05021L5.04874 6.46442L8.58428 9.99995L5.04874 13.5355L6.46296 14.9497L9.99849 11.4142L13.534 14.9497L14.9482 13.5355L11.4127 9.99995L14.9482 6.46442ZM17.0696 2.92889C13.1663 -0.974342 6.83065 -0.974342 2.92742 2.92889C-0.975807 6.83212 -0.975807 13.1678 2.92742 17.071C6.83065 20.9743 13.1663 20.9743 17.0696 17.071C20.9728 13.1678 20.9728 6.83212 17.0696 2.92889ZM4.34164 15.6568C1.22329 12.5385 1.22329 7.46144 4.34164 4.3431C7.45998 1.22476 12.537 1.22476 15.6553 4.3431C18.7737 7.46144 18.7737 12.5385 15.6553 15.6568C12.537 18.7752 7.45998 18.7752 4.34164 15.6568Z</x:String>
|
||||
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
<ResourceDictionary x:Key="Default">
|
||||
<StaticResource x:Key="TextBoxDeleteButtonForeground" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="TextBoxDeleteButtonForegroundPointerOver" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="TextBoxDeleteButtonForegroundPressed" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="TextBoxDeleteButtonForegroundDisabled" ResourceKey="OnSurfaceVariantBrush" />
|
||||
|
||||
<!--#region Filled Text Box Brushes-->
|
||||
<StaticResource x:Key="FilledTextBoxBackground" ResourceKey="SurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBackgroundPointerOver" ResourceKey="OnSurfaceVariantHoverBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBackgroundFocused" ResourceKey="SurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBackgroundDisabled" ResourceKey="OnSurfaceDisabledBrush" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxBorderBrush" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderBrushPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderBrushFocused" ResourceKey="PrimaryBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderBrushDisabled" ResourceKey="OnSurfaceDisabledBrush" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxDeleteButtonForeground" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxDeleteButtonForegroundPointerOver" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxDeleteButtonForegroundFocused" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxDeleteButtonForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxForeground" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxForegroundFocused" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxForegroundDisabled" ResourceKey="OnSurfaceDisabledBrush" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxPlaceholderForeground" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxPlaceholderForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxPlaceholderForegroundFocused" ResourceKey="PrimaryBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxPlaceholderForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Outlined Text Box Brushes-->
|
||||
<StaticResource x:Key="OutlinedTextBoxBorderBrush" ResourceKey="OnSurfaceLowBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxBorderBrushPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxBorderBrushFocused" ResourceKey="PrimaryBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxBorderBrushDisabled" ResourceKey="OnSurfaceDisabledLowBrush" />
|
||||
|
||||
<StaticResource x:Key="OutlinedTextBoxForeground" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxForegroundFocused" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxForegroundDisabled" ResourceKey="OnSurfaceDisabledLowBrush" />
|
||||
|
||||
<StaticResource x:Key="OutlinedTextBoxPlaceholderForeground" ResourceKey="OnSurfaceLowBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxPlaceholderForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxPlaceholderForegroundFocused" ResourceKey="PrimaryBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxPlaceholderForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Typo-->
|
||||
<StaticResource x:Key="OutlinedTextBoxFontFamily" ResourceKey="MaterialMediumFontFamily" />
|
||||
<StaticResource x:Key="OutlinedTextBoxFontWeight" ResourceKey="BodyLargeFontWeight" />
|
||||
<StaticResource x:Key="OutlinedTextBoxFontSize" ResourceKey="BodyLargeFontSize" />
|
||||
<StaticResource x:Key="OutlinedTextBoxCharacterSpacing" ResourceKey="BodyLargeCharacterSpacing" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxFontFamily" ResourceKey="MaterialMediumFontFamily" />
|
||||
<StaticResource x:Key="FilledTextBoxFontWeight" ResourceKey="BodyLargeFontWeight" />
|
||||
<StaticResource x:Key="FilledTextBoxFontSize" ResourceKey="BodyLargeFontSize" />
|
||||
<StaticResource x:Key="FilledTextBoxCharacterSpacing" ResourceKey="BodyLargeCharacterSpacing" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderThicknessNormal" ResourceKey="TextBoxOutlinedStrokeHeight" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderThicknessFocused" ResourceKey="TextBoxFocusStrokeWidth" />
|
||||
<!--#endregion-->
|
||||
</ResourceDictionary>
|
||||
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<StaticResource x:Key="TextBoxDeleteButtonForeground" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="TextBoxDeleteButtonForegroundPointerOver" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="TextBoxDeleteButtonForegroundPressed" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="TextBoxDeleteButtonForegroundDisabled" ResourceKey="OnSurfaceVariantBrush" />
|
||||
|
||||
<!--#region Filled Text Box Brushes-->
|
||||
<StaticResource x:Key="FilledTextBoxBackground" ResourceKey="SurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBackgroundPointerOver" ResourceKey="OnSurfaceVariantHoverBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBackgroundFocused" ResourceKey="SurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBackgroundDisabled" ResourceKey="OnSurfaceDisabledBrush" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxBorderBrush" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderBrushPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderBrushFocused" ResourceKey="PrimaryBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderBrushDisabled" ResourceKey="OnSurfaceDisabledBrush" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxDeleteButtonForeground" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxDeleteButtonForegroundPointerOver" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxDeleteButtonForegroundFocused" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxDeleteButtonForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxForeground" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxForegroundFocused" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxForegroundDisabled" ResourceKey="OnSurfaceDisabledBrush" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxPlaceholderForeground" ResourceKey="OnSurfaceVariantBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxPlaceholderForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxPlaceholderForegroundFocused" ResourceKey="PrimaryBrush" />
|
||||
<StaticResource x:Key="FilledTextBoxPlaceholderForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Outlined Text Box Brushes-->
|
||||
<StaticResource x:Key="OutlinedTextBoxBorderBrush" ResourceKey="OnSurfaceLowBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxBorderBrushPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxBorderBrushFocused" ResourceKey="PrimaryBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxBorderBrushDisabled" ResourceKey="OnSurfaceDisabledLowBrush" />
|
||||
|
||||
<StaticResource x:Key="OutlinedTextBoxForeground" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxForegroundFocused" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxForegroundDisabled" ResourceKey="OnSurfaceDisabledLowBrush" />
|
||||
|
||||
<StaticResource x:Key="OutlinedTextBoxPlaceholderForeground" ResourceKey="OnSurfaceLowBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxPlaceholderForegroundPointerOver" ResourceKey="OnSurfaceBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxPlaceholderForegroundFocused" ResourceKey="PrimaryBrush" />
|
||||
<StaticResource x:Key="OutlinedTextBoxPlaceholderForegroundDisabled" ResourceKey="OnSurfaceLowBrush" />
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Typo-->
|
||||
<StaticResource x:Key="OutlinedTextBoxFontFamily" ResourceKey="MaterialMediumFontFamily" />
|
||||
<StaticResource x:Key="OutlinedTextBoxFontWeight" ResourceKey="BodyLargeFontWeight" />
|
||||
<StaticResource x:Key="OutlinedTextBoxFontSize" ResourceKey="BodyLargeFontSize" />
|
||||
<StaticResource x:Key="OutlinedTextBoxCharacterSpacing" ResourceKey="BodyLargeCharacterSpacing" />
|
||||
|
||||
<StaticResource x:Key="FilledTextBoxFontFamily" ResourceKey="MaterialMediumFontFamily" />
|
||||
<StaticResource x:Key="FilledTextBoxFontWeight" ResourceKey="BodyLargeFontWeight" />
|
||||
<StaticResource x:Key="FilledTextBoxFontSize" ResourceKey="BodyLargeFontSize" />
|
||||
<StaticResource x:Key="FilledTextBoxCharacterSpacing" ResourceKey="BodyLargeCharacterSpacing" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderThicknessNormal" ResourceKey="TextBoxOutlinedStrokeHeight" />
|
||||
<StaticResource x:Key="FilledTextBoxBorderThicknessFocused" ResourceKey="TextBoxFocusStrokeWidth" />
|
||||
<!--#endregion-->
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
|
||||
<!--#region Delete Button Style-->
|
||||
<x:Double x:Key="MaterialTextBoxClearGlyphWidth">20</x:Double>
|
||||
<x:Double x:Key="MaterialTextBoxClearGlyphHeight">20</x:Double>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Filled Text Box Style-->
|
||||
<CornerRadius x:Key="MaterialFilledTextBoxCornerRadius">4,4,0,0</CornerRadius>
|
||||
<macos:Thickness x:Key="MaterialFilledTextBoxPadding">16,7</macos:Thickness>
|
||||
<not_macos:Thickness x:Key="MaterialFilledTextBoxPadding">16</not_macos:Thickness>
|
||||
<x:Double x:Key="MaterialFilledTextBoxMinHeight">58</x:Double>
|
||||
<x:Double x:Key="MaterialFilledTextBoxBorderHeightFocused">2</x:Double>
|
||||
<!--#endregion-->
|
||||
|
||||
<!--#region Outlined Text Box Style-->
|
||||
<x:Double x:Key="MaterialOutlinedTextBoxBorderThickness">1</x:Double>
|
||||
<CornerRadius x:Key="MaterialOutlinedTextBoxCornerRadius">4</CornerRadius>
|
||||
<macos:Thickness x:Key="MaterialOutlinedTextBoxPadding">16,7,14,7</macos:Thickness>
|
||||
<not_macos:Thickness x:Key="MaterialOutlinedTextBoxPadding">16,16,14,16</not_macos:Thickness>
|
||||
<x:Double x:Key="MaterialOutlinedTextBoxMinHeight">56</x:Double>
|
||||
<Thickness x:Key="MaterialOutlinedTextBoxBorderPadding">1</Thickness>
|
||||
<x:Double x:Key="MaterialOutlinedTextBoxBorderThicknessFocused">2</x:Double>
|
||||
<!--#endregion-->
|
||||
|
||||
<SolidColorBrush x:Key="MaterialDisabledOutlinedTextBoxBorderBrush"
|
||||
Opacity="0.12"
|
||||
Color="{ThemeResource OnSurfaceColor}" />
|
||||
|
||||
|
||||
<Style x:Key="MaterialDeleteButtonStyle"
|
||||
TargetType="Button">
|
||||
<Setter Property="Foreground"
|
||||
Value="{ThemeResource OnSurfaceBrush}" />
|
||||
Value="{ThemeResource TextBoxDeleteButtonForeground}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
|
@ -33,25 +188,35 @@
|
|||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="PointerOver" />
|
||||
<VisualState x:Name="Pressed" />
|
||||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="GlyphElement.Fill"
|
||||
Value="{ThemeResource TextBoxDeleteButtonForegroundPointerOver}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="GlyphElement.Fill"
|
||||
Value="{ThemeResource TextBoxDeleteButtonForegroundPressed}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ButtonLayoutGrid.Opacity"
|
||||
Value="0" />
|
||||
<Setter Target="GlyphElement.Fill"
|
||||
Value="{ThemeResource TextBoxDeleteButtonForegroundDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
|
||||
<Path x:Name="GlyphElement"
|
||||
Data="{StaticResource M3ClearGlyphPathData}"
|
||||
Data="{ThemeResource MaterialTextBoxClearGlyphData}"
|
||||
Fill="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Stretch="Uniform"
|
||||
Width="18"
|
||||
Height="18"
|
||||
Width="{ThemeResource MaterialTextBoxClearGlyphWidth}"
|
||||
Height="{ThemeResource MaterialTextBoxClearGlyphHeight}"
|
||||
AutomationProperties.AccessibilityView="Raw" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
@ -62,38 +227,38 @@
|
|||
<Style x:Key="MaterialFilledTextBoxStyle"
|
||||
TargetType="TextBox">
|
||||
<Setter Property="Foreground"
|
||||
Value="{ThemeResource OnSurfaceBrush}" />
|
||||
Value="{ThemeResource FilledTextBoxForeground}" />
|
||||
<Setter Property="PlaceholderForeground"
|
||||
Value="{ThemeResource OnSurfaceVariantBrush}" />
|
||||
Value="{ThemeResource FilledTextBoxPlaceholderForeground}" />
|
||||
<Setter Property="Background"
|
||||
Value="{ThemeResource SurfaceVariantBrush}" />
|
||||
Value="{ThemeResource FilledTextBoxBackground}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{ThemeResource OnSurfaceLowBrush}" />
|
||||
Value="{ThemeResource FilledTextBoxBorderBrush}" />
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="4,4,0,0" />
|
||||
Value="{ThemeResource MaterialFilledTextBoxCornerRadius}" />
|
||||
|
||||
<!-- Start: Body Large Typo -->
|
||||
<Setter Property="FontFamily"
|
||||
Value="{ThemeResource MaterialMediumFontFamily}" />
|
||||
Value="{ThemeResource FilledTextBoxFontFamily}" />
|
||||
<Setter Property="FontWeight"
|
||||
Value="{ThemeResource BodyLargeFontWeight}" />
|
||||
Value="{ThemeResource FilledTextBoxFontWeight}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="{ThemeResource BodyLargeFontSize}" />
|
||||
Value="{ThemeResource FilledTextBoxFontSize}" />
|
||||
<Setter Property="CharacterSpacing"
|
||||
Value="{ThemeResource BodyLargeCharacterSpacing}" />
|
||||
Value="{ThemeResource FilledTextBoxCharacterSpacing}" />
|
||||
<!-- End: Body Large Typo -->
|
||||
|
||||
<macos:Setter Property="Padding"
|
||||
Value="16,7" />
|
||||
Value="{ThemeResource MaterialFilledTextBoxPadding}" />
|
||||
<not_macos:Setter Property="Padding"
|
||||
Value="16" />
|
||||
Value="{ThemeResource MaterialFilledTextBoxPadding}" />
|
||||
|
||||
<Setter Property="MinHeight"
|
||||
Value="58" />
|
||||
Value="{ThemeResource MaterialFilledTextBoxMinHeight}" />
|
||||
|
||||
<!-- Workaround for WinUI issue: https://github.com/microsoft/microsoft-ui-xaml/issues/6388 -->
|
||||
<Setter Property="um:ControlExtensions.Icon"
|
||||
|
@ -113,9 +278,15 @@
|
|||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="NormalBorder.Fill"
|
||||
Value="{ThemeResource OnSurfaceBrush}" />
|
||||
<Setter Target="NormalBorder.Height"
|
||||
Value="2" />
|
||||
Value="{ThemeResource FilledTextBoxBorderBrushPointerOver}" />
|
||||
<Setter Target="Root.Background"
|
||||
Value="{ThemeResource FilledTextBoxBackgroundPointerOver}" />
|
||||
<Setter Target="PlaceholderElement.Foreground"
|
||||
Value="{ThemeResource FilledTextBoxPlaceholderForegroundPointerOver}" />
|
||||
<Setter Target="ContentElement.Foreground"
|
||||
Value="{ThemeResource FilledTextBoxForegroundPointerOver}" />
|
||||
<Setter Target="DeleteButton.Foreground"
|
||||
Value="{ThemeResource FilledTextBoxDeleteButtonForegroundPointerOver}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
|
@ -124,24 +295,32 @@
|
|||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="NormalBorder.Fill"
|
||||
Value="{ThemeResource OnSurfaceLowBrush}" />
|
||||
<Setter Target="ContentElement.Opacity"
|
||||
Value="{StaticResource DisabledOpacity}" />
|
||||
Value="{ThemeResource FilledTextBoxBorderBrushDisabled}" />
|
||||
<Setter Target="ContentElement.Foreground"
|
||||
Value="{ThemeResource FilledTextBoxForegroundDisabled}" />
|
||||
<Setter Target="PlaceholderElement.Foreground"
|
||||
Value="{ThemeResource OnSurfaceLowBrush}" />
|
||||
Value="{ThemeResource FilledTextBoxPlaceholderForegroundDisabled}" />
|
||||
<Setter Target="Root.Background"
|
||||
Value="{ThemeResource OnSurfaceDisabledLowBrush}" />
|
||||
Value="{ThemeResource FilledTextBoxBackgroundDisabled}" />
|
||||
<Setter Target="DeleteButton.Foreground"
|
||||
Value="{ThemeResource FilledTextBoxDeleteButtonForegroundDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Focused">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="PlaceholderElement.Foreground"
|
||||
Value="{ThemeResource PrimaryBrush}" />
|
||||
Value="{ThemeResource FilledTextBoxPlaceholderForegroundFocused}" />
|
||||
<Setter Target="NormalBorder.Height"
|
||||
Value="2" />
|
||||
Value="{ThemeResource MaterialFilledTextBoxBorderHeightFocused}" />
|
||||
<Setter Target="NormalBorder.Fill"
|
||||
Value="{ThemeResource PrimaryBrush}" />
|
||||
Value="{ThemeResource FilledTextBoxBorderBrushFocused}" />
|
||||
<Setter Target="Root.Background"
|
||||
Value="{ThemeResource FilledTextBoxBackgroundFocused}" />
|
||||
<Setter Target="ContentElement.Foreground"
|
||||
Value="{ThemeResource FilledTextBoxForegroundFocused}" />
|
||||
<Setter Target="DeleteButton.Foreground"
|
||||
Value="{ThemeResource FilledTextBoxDeleteButtonForegroundFocused}" />
|
||||
</VisualState.Setters>
|
||||
<Storyboard>
|
||||
|
||||
|
@ -266,7 +445,7 @@
|
|||
<Button x:Name="DeleteButton"
|
||||
Grid.Column="2"
|
||||
Margin="8,0,0,0"
|
||||
Foreground="{ThemeResource OnSurfaceVariantBrush}"
|
||||
Foreground="{ThemeResource FilledTextBoxDeleteButtonForeground}"
|
||||
IsTabStop="False"
|
||||
Style="{StaticResource MaterialDeleteButtonStyle}"
|
||||
VerticalAlignment="Stretch"
|
||||
|
@ -276,12 +455,12 @@
|
|||
|
||||
<Rectangle x:Name="NormalBorder"
|
||||
Fill="{TemplateBinding BorderBrush}"
|
||||
Height="{StaticResource TextBoxOutlinedStrokeHeight}"
|
||||
Height="{ThemeResource FilledTextBoxBorderThicknessNormal}"
|
||||
VerticalAlignment="Bottom" />
|
||||
|
||||
<Rectangle x:Name="FocusedBorder"
|
||||
Fill="{ThemeResource PrimaryBrush}"
|
||||
Height="{StaticResource TextBoxFocusStrokeWidth}"
|
||||
Fill="{ThemeResource FilledTextBoxBorderBrushFocused}"
|
||||
Height="{ThemeResource FilledTextBoxBorderThicknessFocused}"
|
||||
VerticalAlignment="Bottom"
|
||||
not_macos:RenderTransformOrigin="0.5,0.5"
|
||||
macos:RenderTransformOrigin="0.0,0.5">
|
||||
|
@ -302,25 +481,25 @@
|
|||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
<Setter Property="Foreground"
|
||||
Value="{ThemeResource OnSurfaceBrush}" />
|
||||
Value="{ThemeResource OutlinedTextBoxForeground}" />
|
||||
<Setter Property="PlaceholderForeground"
|
||||
Value="{ThemeResource OnSurfaceLowBrush}" />
|
||||
Value="{ThemeResource OutlinedTextBoxPlaceholderForeground}" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{ThemeResource OnSurfaceLowBrush}" />
|
||||
Value="{ThemeResource OutlinedTextBoxBorderBrush}" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="1" />
|
||||
Value="{ThemeResource MaterialOutlinedTextBoxBorderThickness}" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="4" />
|
||||
Value="{ThemeResource MaterialOutlinedTextBoxCornerRadius}" />
|
||||
|
||||
<!-- Start: Body Large Typo -->
|
||||
<Setter Property="FontFamily"
|
||||
Value="{ThemeResource MaterialMediumFontFamily}" />
|
||||
Value="{ThemeResource OutlinedTextBoxFontFamily}" />
|
||||
<Setter Property="FontWeight"
|
||||
Value="{ThemeResource BodyLargeFontWeight}" />
|
||||
Value="{ThemeResource OutlinedTextBoxFontWeight}" />
|
||||
<Setter Property="FontSize"
|
||||
Value="{ThemeResource BodyLargeFontSize}" />
|
||||
Value="{ThemeResource OutlinedTextBoxFontSize}" />
|
||||
<Setter Property="CharacterSpacing"
|
||||
Value="{ThemeResource BodyLargeCharacterSpacing}" />
|
||||
Value="{ThemeResource OutlinedTextBoxCharacterSpacing}" />
|
||||
<!-- End: Body Large Typo -->
|
||||
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
|
@ -329,12 +508,12 @@
|
|||
Value="Center" />
|
||||
|
||||
<macos:Setter Property="Padding"
|
||||
Value="16,7,14,7" />
|
||||
Value="{ThemeResource MaterialOutlinedTextBoxPadding}" />
|
||||
<not_macos:Setter Property="Padding"
|
||||
Value="16,16,14,16" />
|
||||
Value="{ThemeResource MaterialOutlinedTextBoxPadding}" />
|
||||
|
||||
<Setter Property="MinHeight"
|
||||
Value="56" />
|
||||
Value="{ThemeResource MaterialOutlinedTextBoxMinHeight}" />
|
||||
|
||||
<!-- Workaround for WinUI issue: https://github.com/microsoft/microsoft-ui-xaml/issues/6388 -->
|
||||
<Setter Property="um:ControlExtensions.Icon"
|
||||
|
@ -347,7 +526,7 @@
|
|||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
Padding="1">
|
||||
Padding="{ThemeResource MaterialOutlinedTextBoxBorderPadding}">
|
||||
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
|
@ -355,11 +534,11 @@
|
|||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootBorder.BorderBrush"
|
||||
Value="{ThemeResource OnSurfaceBrush}" />
|
||||
<Setter Target="RootBorder.BorderThickness"
|
||||
Value="2" />
|
||||
<Setter Target="RootBorder.Padding"
|
||||
Value="0" />
|
||||
Value="{ThemeResource OutlinedTextBoxBorderBrushPointerOver}" />
|
||||
<Setter Target="ContentElement.Foreground"
|
||||
Value="{ThemeResource OutlinedTextBoxForegroundPointerOver}" />
|
||||
<Setter Target="PlaceholderElement.Foreground"
|
||||
Value="{ThemeResource OutlinedTextBoxPlaceholderForegroundPointerOver}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Pressed" />
|
||||
|
@ -367,22 +546,25 @@
|
|||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootBorder.BorderBrush"
|
||||
Value="{ThemeResource OnSurfaceDisabledLowBrush}" />
|
||||
<Setter Target="ContentElement.Opacity"
|
||||
Value="{StaticResource DisabledOpacity}" />
|
||||
Value="{ThemeResource OutlinedTextBoxBorderBrushDisabled}" />
|
||||
<Setter Target="ContentElement.Foreground"
|
||||
Value="{ThemeResource OutlinedTextBoxForegroundDisabled}" />
|
||||
<Setter Target="PlaceholderElement.Foreground"
|
||||
Value="{ThemeResource OnSurfaceLowBrush}" />
|
||||
Value="{ThemeResource OutlinedTextBoxPlaceholderForegroundDisabled}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState x:Name="Focused">
|
||||
<VisualState.Setters>
|
||||
<!--ICI-->
|
||||
<Setter Target="RootBorder.BorderBrush"
|
||||
Value="{ThemeResource PrimaryBrush}" />
|
||||
Value="{ThemeResource OutlinedTextBoxBorderBrushFocused}" />
|
||||
<Setter Target="ContentElement.Foreground"
|
||||
Value="{ThemeResource OutlinedTextBoxForegroundFocused}" />
|
||||
<Setter Target="PlaceholderElement.Foreground"
|
||||
Value="{ThemeResource PrimaryBrush}" />
|
||||
Value="{ThemeResource OutlinedTextBoxPlaceholderForegroundFocused}" />
|
||||
<Setter Target="RootBorder.BorderThickness"
|
||||
Value="2" />
|
||||
Value="{ThemeResource MaterialOutlinedTextBoxBorderThicknessFocused}" />
|
||||
<Setter Target="RootBorder.Padding"
|
||||
Value="0" />
|
||||
</VisualState.Setters>
|
||||
|
|
Загрузка…
Ссылка в новой задаче