Browse Source

Fluent: Replace ErrorBrush resources

pull/4411/head
Maksym Katsydan 6 years ago
parent
commit
eadf450083
  1. 8
      src/Avalonia.Themes.Fluent/ButtonSpinner.xaml
  2. 18
      src/Avalonia.Themes.Fluent/DataValidationErrors.xaml
  3. 13
      src/Avalonia.Themes.Fluent/TextBox.xaml

8
src/Avalonia.Themes.Fluent/ButtonSpinner.xaml

@ -8,7 +8,11 @@
<StackPanel Spacing="20">
<ButtonSpinner ButtonSpinnerLocation="Right"
Content="Right disabled inline spinner"
AllowSpin="False" />
AllowSpin="False">
<DataValidationErrors.Error>
<sys:Exception />
</DataValidationErrors.Error>
</ButtonSpinner>
<ButtonSpinner ButtonSpinnerLocation="Left"
Content="Left spinner" />
<ButtonSpinner ShowButtonSpinner="False"
@ -133,7 +137,7 @@
<!-- Error state -->
<Style Selector="ButtonSpinner:error">
<Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemErrorTextColor}" />
</Style>
</Styles>

18
src/Avalonia.Themes.Fluent/DataValidationErrors.xaml

@ -1,5 +1,16 @@
<Style xmlns="https://github.com/avaloniaui"
Selector="DataValidationErrors">
Selector="DataValidationErrors"
xmlns:sys="clr-namespace:System;assembly=netstandard">
<Design.PreviewWith>
<Border Padding="20">
<TextBox Text="Sample">
<DataValidationErrors.Error>
<sys:Exception/>
</DataValidationErrors.Error>
</TextBox>
</Border>
</Design.PreviewWith>
<Setter Property="Template">
<ControlTemplate>
<DockPanel LastChildFill="True">
@ -24,14 +35,13 @@
Background="Transparent">
<Canvas.Styles>
<Style Selector="ToolTip">
<Setter Property="Background" Value="{DynamicResource ErrorLowBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/>
</Style>
</Canvas.Styles>
<ToolTip.Tip>
<ItemsControl Items="{Binding}"/>
</ToolTip.Tip>
<Path Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2" Stroke="{DynamicResource ErrorBrush}" StrokeThickness="2"/>
<Path Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2" Stroke="{DynamicResource SystemControlErrorTextForegroundBrush}" StrokeThickness="2"/>
</Canvas>
</DataTemplate>
</Setter>

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

@ -1,4 +1,13 @@
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith>
<Border Padding="20">
<TextBox Text="Sample"
FontSize="20"
Width="100"
TextAlignment="Center"/>
</Border>
</Design.PreviewWith>
<Styles.Resources>
<Thickness x:Key="TextBoxTopHeaderMargin">0,0,0,4</Thickness>
</Styles.Resources>
@ -42,7 +51,7 @@
<DockPanel>
<TextBlock Name="floatingWatermark"
Foreground="{DynamicResource SystemAccentColor}"
FontSize="{DynamicResource FontSizeSmall}"
FontSize="{TemplateBinding FontSize}"
Text="{TemplateBinding Watermark}"
DockPanel.Dock="Top">
<TextBlock.IsVisible>
@ -136,7 +145,7 @@
<Style Selector="TextBox:error /template/ Border#border">
<Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/>
</Style>
<Style Selector="TextBox /template/ DockPanel">

Loading…
Cancel
Save