Browse Source
Fix Placeholder not visible (#21024)
* Add default PlaceholderForeground to AutoCompleteBox, CalendarDatePicker and NumericUpDown.
* Add PlaceholderText template binding for simple theme ComboBox PART_EditableTextBox.
pull/21042/head
shine
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with
7 additions and
0 deletions
-
src/Avalonia.Themes.Fluent/Controls/AutoCompleteBox.xaml
-
src/Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml
-
src/Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml
-
src/Avalonia.Themes.Simple/Controls/AutoCompleteBox.xaml
-
src/Avalonia.Themes.Simple/Controls/CalendarDatePicker.xaml
-
src/Avalonia.Themes.Simple/Controls/ComboBox.xaml
-
src/Avalonia.Themes.Simple/Controls/NumericUpDown.xaml
|
|
|
@ -25,6 +25,7 @@ |
|
|
|
<Setter Property="VerticalAlignment" Value="Top" /> |
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|
|
|
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
|
|
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextControlPlaceholderForeground}" /> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
|
|
|
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
|
|
|
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|
|
|
|
|
|
|
@ -63,6 +63,7 @@ |
|
|
|
<ControlTheme x:Key="{x:Type CalendarDatePicker}" TargetType="CalendarDatePicker"> |
|
|
|
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}" /> |
|
|
|
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}" /> |
|
|
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextControlPlaceholderForeground}" /> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" /> |
|
|
|
<Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThemeThickness}" /> |
|
|
|
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|
|
|
|
|
|
|
@ -52,6 +52,7 @@ |
|
|
|
<ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown"> |
|
|
|
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|
|
|
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
|
|
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextControlPlaceholderForeground}" /> |
|
|
|
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
|
|
|
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" /> |
|
|
|
|
|
|
|
@ -4,6 +4,7 @@ |
|
|
|
<ControlTheme x:Key="{x:Type AutoCompleteBox}" |
|
|
|
TargetType="AutoCompleteBox"> |
|
|
|
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" /> |
|
|
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource ThemeForegroundLowBrush}" /> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" /> |
|
|
|
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" /> |
|
|
|
<Setter Property="Padding" Value="4" /> |
|
|
|
|
|
|
|
@ -12,6 +12,7 @@ |
|
|
|
<ControlTheme x:Key="{x:Type CalendarDatePicker}" |
|
|
|
TargetType="CalendarDatePicker"> |
|
|
|
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" /> |
|
|
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource ThemeForegroundLowBrush}" /> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" /> |
|
|
|
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" /> |
|
|
|
<Setter Property="Padding" Value="4" /> |
|
|
|
|
|
|
|
@ -50,6 +50,7 @@ |
|
|
|
Foreground="{TemplateBinding Foreground}" |
|
|
|
Background="Transparent" |
|
|
|
Text="{TemplateBinding Text, Mode=TwoWay}" |
|
|
|
PlaceholderText="{TemplateBinding PlaceholderText}" |
|
|
|
BorderThickness="0" |
|
|
|
IsVisible="{TemplateBinding IsEditable}"> |
|
|
|
<TextBox.Resources> |
|
|
|
|
|
|
|
@ -4,6 +4,7 @@ |
|
|
|
<ControlTheme x:Key="{x:Type NumericUpDown}" |
|
|
|
TargetType="NumericUpDown"> |
|
|
|
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" /> |
|
|
|
<Setter Property="PlaceholderForeground" Value="{DynamicResource ThemeForegroundLowBrush}" /> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" /> |
|
|
|
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" /> |
|
|
|
<Setter Property="Padding" Value="4" /> |
|
|
|
|