committed by
GitHub
10 changed files with 260 additions and 70 deletions
@ -1,8 +1,8 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.Base.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.BaseDark.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.Base.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.FluentBaseDark.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.FluentControlResourcesDark.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
</Styles> |
|||
|
|||
@ -1,8 +1,8 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.Base.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.Base.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.FluentBaseLight.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
<StyleInclude Source="resm:Avalonia.Themes.Fluent.Accents.FluentControlResourcesLight.xaml?assembly=Avalonia.Themes.Fluent" /> |
|||
</Styles> |
|||
|
|||
@ -1,78 +1,152 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Styles.Resources> |
|||
<Thickness x:Key="TextBoxTopHeaderMargin">0,0,0,4</Thickness> |
|||
</Styles.Resources> |
|||
<Style Selector="TextBox"> |
|||
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> |
|||
<Setter Property="SelectionBrush" Value="{DynamicResource HighlightBrush}"/> |
|||
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource HighlightForegroundBrush}"/> |
|||
<Setter Property="Padding" Value="4"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
|||
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
|||
<Setter Property="SelectionBrush" Value="{DynamicResource TextControlSelectionHighlightColor}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
|||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" /> |
|||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" /> |
|||
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="border" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}"> |
|||
<DockPanel Margin="{TemplateBinding Padding}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
|||
|
|||
<TextBlock Name="floatingWatermark" |
|||
Foreground="{DynamicResource ThemeAccentBrush}" |
|||
FontSize="{DynamicResource FontSizeSmall}" |
|||
Text="{TemplateBinding Watermark}" |
|||
DockPanel.Dock="Top"> |
|||
<TextBlock.IsVisible> |
|||
<MultiBinding Converter="{x:Static BoolConverters.And}"> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
|||
Path="UseFloatingWatermark"/> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
|||
Path="Text" |
|||
Converter="{x:Static StringConverters.IsNotNullOrEmpty}"/> |
|||
</MultiBinding> |
|||
</TextBlock.IsVisible> |
|||
</TextBlock> |
|||
|
|||
<DataValidationErrors> |
|||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"> |
|||
|
|||
<Panel> |
|||
<TextBlock Name="watermark" |
|||
Opacity="0.5" |
|||
Text="{TemplateBinding Watermark}" |
|||
IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}"/> |
|||
<TextPresenter Name="PART_TextPresenter" |
|||
Text="{TemplateBinding Text, Mode=TwoWay}" |
|||
CaretIndex="{TemplateBinding CaretIndex}" |
|||
SelectionStart="{TemplateBinding SelectionStart}" |
|||
SelectionEnd="{TemplateBinding SelectionEnd}" |
|||
TextAlignment="{TemplateBinding TextAlignment}" |
|||
TextWrapping="{TemplateBinding TextWrapping}" |
|||
PasswordChar="{TemplateBinding PasswordChar}" |
|||
SelectionBrush="{TemplateBinding SelectionBrush}" |
|||
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}" |
|||
CaretBrush="{TemplateBinding CaretBrush}"/> |
|||
</Panel> |
|||
</ScrollViewer> |
|||
</DataValidationErrors> |
|||
</DockPanel> |
|||
</Border> |
|||
<Grid RowDefinitions="Auto, *, Auto" ColumnDefinitions="*, Auto"> |
|||
|
|||
<!-- TODO bind Content -> Header and ContentTemplate -> HeaderTemplate --> |
|||
<ContentPresenter x:Name="HeaderContentPresenter" |
|||
Grid.Row="0" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="2" |
|||
TextBlock.FontWeight="Normal" |
|||
TextBlock.Foreground="{DynamicResource TextControlHeaderForeground}" |
|||
Margin="{DynamicResource TextBoxTopHeaderMargin}" /> |
|||
|
|||
<Border Name="border" |
|||
Grid.Row="1" |
|||
Grid.Column="0" |
|||
Grid.RowSpan="1" |
|||
Grid.ColumnSpan="2" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{DynamicResource ControlCornerRadius}" |
|||
Margin="{TemplateBinding BorderThickness}" |
|||
MinWidth="{TemplateBinding MinWidth}" |
|||
MinHeight="{TemplateBinding MinHeight}"> |
|||
</Border> |
|||
|
|||
<Border Padding="{TemplateBinding Padding}" |
|||
Grid.Row="1" |
|||
Grid.Column="0" |
|||
Margin="{TemplateBinding BorderThickness}"> |
|||
<DockPanel> |
|||
<TextBlock Name="floatingWatermark" |
|||
Foreground="{DynamicResource ThemeAccentBrush}" |
|||
FontSize="{DynamicResource FontSizeSmall}" |
|||
Text="{TemplateBinding Watermark}" |
|||
DockPanel.Dock="Top"> |
|||
<TextBlock.IsVisible> |
|||
<MultiBinding Converter="{x:Static BoolConverters.And}"> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
|||
Path="UseFloatingWatermark"/> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
|||
Path="Text" |
|||
Converter="{x:Static StringConverters.IsNotNullOrEmpty}"/> |
|||
</MultiBinding> |
|||
</TextBlock.IsVisible> |
|||
</TextBlock> |
|||
|
|||
<DataValidationErrors> |
|||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"> |
|||
|
|||
<Panel> |
|||
<TextBlock Name="watermark" |
|||
Opacity="0.5" |
|||
Text="{TemplateBinding Watermark}" |
|||
IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}"/> |
|||
<!-- TODO eliminate this margin... text layout issue? --> |
|||
<TextPresenter Name="PART_TextPresenter" |
|||
Margin="0 1 0 0" |
|||
Text="{TemplateBinding Text, Mode=TwoWay}" |
|||
CaretIndex="{TemplateBinding CaretIndex}" |
|||
SelectionStart="{TemplateBinding SelectionStart}" |
|||
SelectionEnd="{TemplateBinding SelectionEnd}" |
|||
TextAlignment="{TemplateBinding TextAlignment}" |
|||
TextWrapping="{TemplateBinding TextWrapping}" |
|||
PasswordChar="{TemplateBinding PasswordChar}" |
|||
SelectionBrush="{TemplateBinding SelectionBrush}" |
|||
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}" |
|||
CaretBrush="{TemplateBinding CaretBrush}"/> |
|||
</Panel> |
|||
</ScrollViewer> |
|||
</DataValidationErrors> |
|||
</DockPanel> |
|||
</Border> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="TextBox:disabled"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TextBox:disabled /template/ Border#border"> |
|||
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TextBox:disabled /template/ TextBlock#watermark, TextBox:disabled /template/ TextBlock#floatingWatermark"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver State--> |
|||
<Style Selector="TextBox:disabled"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TextBox:pointerover /template/ Border#border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushPointerOver}"/> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TextBox:pointerover /template/ TextBlock#watermark, TextBox:pointerover /template/ TextBlock#floatingWatermark"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Focused State --> |
|||
<Style Selector="TextBox:focus"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TextBox:focus /template/ TextBlock#watermark, TextBox:focus /template/ TextBlock#floatingWatermark"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundFocused}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TextBox:focus /template/ Border#border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundFocused}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}"/> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" /> |
|||
</Style> |
|||
|
|||
|
|||
<Style Selector="TextBox:error /template/ Border#border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="TextBox /template/ DockPanel"> |
|||
<Setter Property="Cursor" Value="IBeam" /> |
|||
</Style> |
|||
<Style Selector="TextBox:disabled /template/ Border#border"> |
|||
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" /> |
|||
</Style> |
|||
|
|||
</Styles> |
|||
|
|||
Loading…
Reference in new issue