Browse Source

Fluent TextBox: Update naming and fix nits from previous PR

pull/4487/head
Maksym Katsydan 6 years ago
parent
commit
71393ceb6a
  1. 19
      src/Avalonia.Themes.Fluent/TextBox.xaml

19
src/Avalonia.Themes.Fluent/TextBox.xaml

@ -26,12 +26,13 @@
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" />
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" /> <Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" /> <Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" />
<Setter Property="FocusAdorner" Value="{x:Null}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<DockPanel> <DockPanel>
<!-- TODO bind Content -> Header and ContentTemplate -> HeaderTemplate --> <!-- TODO bind Content -> Header and ContentTemplate -> HeaderTemplate -->
<ContentPresenter x:Name="HeaderContentPresenter" <ContentPresenter x:Name="PART_HeaderContentPresenter"
DockPanel.Dock="Top" DockPanel.Dock="Top"
TextBlock.FontWeight="Normal" TextBlock.FontWeight="Normal"
TextBlock.Foreground="{DynamicResource TextControlHeaderForeground}" TextBlock.Foreground="{DynamicResource TextControlHeaderForeground}"
@ -40,7 +41,7 @@
<Panel> <Panel>
<Border <Border
Name="border" Name="PART_BorderElement"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
@ -53,10 +54,10 @@
Margin="{TemplateBinding BorderThickness}"> Margin="{TemplateBinding BorderThickness}">
<Grid ColumnDefinitions="Auto,*,Auto" > <Grid ColumnDefinitions="Auto,*,Auto" >
<ContentPresenter Grid.Column="0" Grid.ColumnSpan="1" Content="{TemplateBinding InnerLeftContent}"/> <ContentPresenter Grid.Column="0" Grid.ColumnSpan="1" Content="{TemplateBinding InnerLeftContent}"/>
<DockPanel Grid.Column="1" Grid.ColumnSpan="1" Margin="{TemplateBinding Padding}"> <DockPanel x:Name="PART_InnerDockPanel" Grid.Column="1" Grid.ColumnSpan="1" Margin="{TemplateBinding Padding}">
<TextBlock Name="PART_FloatingWatermark" <TextBlock Name="PART_FloatingWatermark"
Foreground="{DynamicResource SystemAccentColor}" Foreground="{DynamicResource SystemAccentColor}"
FontSize="{DynamicResource FontSizeSmall}" FontSize="{TemplateBinding FontSize}"
Text="{TemplateBinding Watermark}" Text="{TemplateBinding Watermark}"
DockPanel.Dock="Top" /> DockPanel.Dock="Top" />
@ -106,7 +107,7 @@
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" /> <Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
</Style> </Style>
<Style Selector="TextBox:disabled /template/ Border#border"> <Style Selector="TextBox:disabled /template/ Border#PART_BorderElement">
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" /> <Setter Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" /> <Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" />
</Style> </Style>
@ -120,7 +121,7 @@
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" /> <Setter Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
</Style> </Style>
<Style Selector="TextBox:pointerover /template/ Border#border"> <Style Selector="TextBox:pointerover /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushPointerOver}"/> <Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushPointerOver}"/>
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" /> <Setter Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" />
</Style> </Style>
@ -138,17 +139,17 @@
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundFocused}" /> <Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundFocused}" />
</Style> </Style>
<Style Selector="TextBox:focus /template/ Border#border"> <Style Selector="TextBox:focus /template/ Border#PART_BorderElement">
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundFocused}"/> <Setter Property="Background" Value="{DynamicResource TextControlBackgroundFocused}"/>
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}"/> <Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}"/>
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" /> <Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
</Style> </Style>
<Style Selector="TextBox:error /template/ Border#border"> <Style Selector="TextBox:error /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/> <Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/>
</Style> </Style>
<Style Selector="TextBox /template/ DockPanel"> <Style Selector="TextBox /template/ DockPanel#PART_InnerDockPanel">
<Setter Property="Cursor" Value="IBeam" /> <Setter Property="Cursor" Value="IBeam" />
</Style> </Style>

Loading…
Cancel
Save