change fonts

This commit is contained in:
2022-03-08 08:54:05 +08:00
parent 4076b2c9ed
commit 91db3caa15
24 changed files with 30 additions and 51 deletions

View File

@ -7,11 +7,7 @@ namespace Billing.Themes
{
public static Color CurrentPrimaryColor => (Color)Application.Current.Resources[PrimaryColor];
public const string CascadiaFontRegular = nameof(CascadiaFontRegular);
public const string CascadiaFontBold = nameof(CascadiaFontBold);
public const string RobotoCondensedFontRegular = nameof(RobotoCondensedFontRegular);
public const string RobotoCondensedFontBold = nameof(RobotoCondensedFontBold);
public const string BrandsFontRegular = nameof(BrandsFontRegular);
public const string FontBold = nameof(FontBold);
public const string WindowBackgroundColor = nameof(WindowBackgroundColor);
public const string OptionTintColor = nameof(OptionTintColor);
@ -32,12 +28,8 @@ namespace Billing.Themes
protected void InitResources()
{
var robotoRegularFontFamily = Definition.GetRobotoCondensedRegularFontFamily();
Add(CascadiaFontRegular, Definition.GetCascadiaRegularFontFamily());
Add(CascadiaFontBold, Definition.GetCascadiaBoldFontFamily());
Add(RobotoCondensedFontRegular, Definition.GetRobotoCondensedRegularFontFamily());
Add(RobotoCondensedFontBold, Definition.GetRobotoCondensedBoldFontFamily());
Add(BrandsFontRegular, Definition.GetBrandsFontFamily());
var regularFontFamily = Definition.GetRegularFontFamily();
Add(FontBold, Definition.GetBoldFontFamily());
Add(PrimaryColor, PrimaryMauiColor);
Add(SecondaryColor, SecondaryMauiColor);
@ -49,7 +41,7 @@ namespace Billing.Themes
{
new Setter { Property = Label.FontSizeProperty, Value = Device.GetNamedSize(NamedSize.Small, typeof(Label)) },
new Setter { Property = Label.TextColorProperty, Value = PrimaryMauiColor },
new Setter { Property = Label.FontFamilyProperty, Value = robotoRegularFontFamily }
new Setter { Property = Label.FontFamilyProperty, Value = regularFontFamily }
}
});
Add(new Style(typeof(OptionEntry))
@ -57,7 +49,7 @@ namespace Billing.Themes
Setters =
{
new Setter { Property = Entry.FontSizeProperty, Value = Device.GetNamedSize(NamedSize.Small, typeof(Entry)) },
new Setter { Property = Entry.FontFamilyProperty, Value = robotoRegularFontFamily }
new Setter { Property = Entry.FontFamilyProperty, Value = regularFontFamily }
}
});
Add(new Style(typeof(OptionEditor))
@ -65,7 +57,7 @@ namespace Billing.Themes
Setters =
{
new Setter { Property = Editor.FontSizeProperty, Value = Device.GetNamedSize(NamedSize.Small, typeof(Editor)) },
new Setter { Property = Editor.FontFamilyProperty, Value = robotoRegularFontFamily }
new Setter { Property = Editor.FontFamilyProperty, Value = regularFontFamily }
}
});
Add(new Style(typeof(OptionDatePicker))
@ -73,7 +65,7 @@ namespace Billing.Themes
Setters =
{
new Setter { Property = DatePicker.FontSizeProperty, Value = Device.GetNamedSize(NamedSize.Small, typeof(DatePicker)) },
new Setter { Property = DatePicker.FontFamilyProperty, Value = robotoRegularFontFamily }
new Setter { Property = DatePicker.FontFamilyProperty, Value = regularFontFamily }
}
});
Add(new Style(typeof(OptionTimePicker))
@ -81,7 +73,7 @@ namespace Billing.Themes
Setters =
{
new Setter { Property = TimePicker.FontSizeProperty, Value = Device.GetNamedSize(NamedSize.Small, typeof(TimePicker)) },
new Setter { Property = TimePicker.FontFamilyProperty, Value = robotoRegularFontFamily }
new Setter { Property = TimePicker.FontFamilyProperty, Value = regularFontFamily }
}
});
Add(new Style(typeof(Button))
@ -89,7 +81,7 @@ namespace Billing.Themes
Setters =
{
new Setter { Property = Button.TextColorProperty, Value = SecondaryMauiColor },
new Setter { Property = Button.FontFamilyProperty, Value = robotoRegularFontFamily },
new Setter { Property = Button.FontFamilyProperty, Value = regularFontFamily },
new Setter { Property = VisualElement.BackgroundColorProperty, Value = PrimaryMauiColor },
new Setter { Property = Button.PaddingProperty, Value = new Thickness(14, 10) }
}