Browse Source

Cleaned up resources for CalendarDayButton,CalendarItem,DataValidationErrors,DatePicker,Expander,Slider

Typeface - Added Typeface.Default.
FormattedTextImpl - Fallback to Typeface.Default for null typeface.
pull/1831/head
William David Cossey 8 years ago
parent
commit
8087f81ea5
  1. 6
      src/Avalonia.Themes.Default/CalendarDayButton.xaml
  2. 4
      src/Avalonia.Themes.Default/CalendarItem.xaml
  3. 2
      src/Avalonia.Themes.Default/DataValidationErrors.xaml
  4. 8
      src/Avalonia.Themes.Default/DatePicker.xaml
  5. 4
      src/Avalonia.Themes.Default/Expander.xaml
  6. 3
      src/Avalonia.Themes.Default/Slider.xaml
  7. 2
      src/Avalonia.Visuals/Media/Typeface.cs
  8. 7
      src/Skia/Avalonia.Skia/FormattedTextImpl.cs

6
src/Avalonia.Themes.Default/CalendarDayButton.xaml

@ -42,7 +42,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
RenderTransformOrigin="0.5,0.5"
Fill="#FF000000"
Fill="{DynamicResource ThemeForegroundBrush}"
Stretch="Fill"
Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z" />
@ -103,7 +103,7 @@
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundLightBrush}"/>
</Style>
<Style Selector="CalendarDayButton:today /template/ ContentControl#Content">
<Setter Property="Foreground" Value="#FFFFFFFF"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeControlLightBrush}"/>
</Style>
<Style Selector="CalendarDayButton /template/ Path#BlackoutVisual">
@ -113,4 +113,4 @@
<Setter Property="Opacity" Value="0.3"/>
</Style>
</Styles>
</Styles>

4
src/Avalonia.Themes.Default/CalendarItem.xaml

@ -153,7 +153,7 @@
<Rectangle Name="DisabledVisual"
Stretch="Fill"
Fill="#FFFFFFFF"
Fill="{DynamicResource ThemeControlLightBrush}"
Opacity="{DynamicResource ThemeDisabledOpacity}"
Margin="0,2,0,2" />
@ -180,4 +180,4 @@
<Setter Property="IsVisible" Value="True"/>
</Style>
</Styles>
</Styles>

2
src/Avalonia.Themes.Default/DataValidationErrors.xaml

@ -21,7 +21,7 @@
<Setter Property="ErrorTemplate">
<DataTemplate>
<Canvas Width="14" Height="14" Margin="4 0 1 0"
Background="#00FFFFFF">
Background="Transparent">
<Canvas.Styles>
<Style Selector="ToolTip">
<Setter Property="Background" Value="{DynamicResource ErrorLightBrush}"/>

8
src/Avalonia.Themes.Default/DatePicker.xaml

@ -28,7 +28,7 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="0"
Background="#FFFFFFFF"
Background="{DynamicResource ThemeControlLightBrush}"
ColumnDefinitions="*,*,*,*"
RowDefinitions="23*,19*,19*,19*"
ClipToBounds="False">
@ -66,7 +66,7 @@
Stretch="Fill"
Data="M11.426758,8.4305077 L11.749023,8.4305077 L11.749023,16.331387 L10.674805,16.331387 L10.674805,10.299648 L9.0742188,11.298672 L9.0742188,10.294277 C9.4788408,10.090176 9.9094238,9.8090878 10.365967,9.4510155 C10.82251,9.0929432 11.176106,8.7527733 11.426758,8.4305077 z M14.65086,8.4305077 L18.566387,8.4305077 L18.566387,9.3435936 L15.671368,9.3435936 L15.671368,11.255703 C15.936341,11.058764 16.27293,10.960293 16.681133,10.960293 C17.411602,10.960293 17.969301,11.178717 18.354229,11.615566 C18.739157,12.052416 18.931622,12.673672 18.931622,13.479336 C18.931622,15.452317 18.052553,16.438808 16.294415,16.438808 C15.560365,16.438808 14.951641,16.234707 14.468243,15.826504 L14.881817,14.929531 C15.368796,15.326992 15.837872,15.525723 16.289043,15.525723 C17.298809,15.525723 17.803692,14.895514 17.803692,13.635098 C17.803692,12.460618 17.305971,11.873379 16.310528,11.873379 C15.83071,11.873379 15.399232,12.079271 15.016094,12.491055 L14.65086,12.238613 z" />
<Ellipse HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#FFFFFFFF" StrokeThickness="0" Grid.ColumnSpan="4" Width="3" Height="3"/>
<Ellipse HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{DynamicResource ThemeControlLightBrush}" StrokeThickness="0" Grid.ColumnSpan="4" Width="3" Height="3"/>
</Grid>
</ControlTemplate>
</Setter>
@ -100,7 +100,7 @@
Width="20"
Classes="CalendarDropDown"
Foreground="{TemplateBinding Foreground}"
Background="#00FFFFFF"
Background="Transparent"
BorderThickness="0"
Margin="2,0,2,0"
Padding="0"
@ -123,4 +123,4 @@
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderDarkBrush}"/>
</Style>
</Styles>
</Styles>

4
src/Avalonia.Themes.Default/Expander.xaml

@ -108,7 +108,7 @@
</Setter>
</Style>
<Style Selector="Expander /template/ ToggleButton#PART_toggle:pointerover /template/ Border">
<Setter Property="BorderBrush" Value="#ffaaaaaa" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderLightBrush}" />
</Style>
<Style Selector="Expander:down:expanded /template/ ToggleButton#PART_toggle /template/ Path">
<Setter Property="RenderTransform">
@ -135,4 +135,4 @@
<RotateTransform Angle="0" />
</Setter>
</Style>
</Styles>
</Styles>

3
src/Avalonia.Themes.Default/Slider.xaml

@ -80,10 +80,11 @@
</Style>
<Style Selector="Slider /template/ RepeatButton.repeattrack">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeBorderLightBrush}"/>
<Setter Property="Template">
<ControlTemplate>
<Border Background="{TemplateBinding Background}" />
</ControlTemplate>
</Setter>
</Style>
</Styles>
</Styles>

2
src/Avalonia.Visuals/Media/Typeface.cs

@ -7,6 +7,8 @@ namespace Avalonia.Media
/// </summary>
public class Typeface
{
public static Typeface Default = new Typeface(FontFamily.Default);
/// <summary>
/// Initializes a new instance of the <see cref="Typeface"/> class.
/// </summary>

7
src/Skia/Avalonia.Skia/FormattedTextImpl.cs

@ -30,6 +30,11 @@ namespace Avalonia.Skia
SKTypeface skiaTypeface = TypefaceCache.Default;
if (typeface == null)
{
typeface = Typeface.Default;
}
if (typeface.FontFamily.Key != null)
{
var typefaces = SKTypefaceCollectionCache.GetOrAddTypefaceCollection(typeface.FontFamily);
@ -723,4 +728,4 @@ namespace Avalonia.Skia
}
}
}
}
}

Loading…
Cancel
Save