mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 21:24:59 +00:00
refactor: change the way loading custom fonts
This commit is contained in:
parent
636096c713
commit
f834af10a2
31 changed files with 136 additions and 183 deletions
|
@ -63,22 +63,14 @@ namespace SourceGit.Views {
|
|||
set => SetValue(ChangeProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<FontFamily> IconFontFamilyProperty =
|
||||
AvaloniaProperty.Register<Avatar, FontFamily>(nameof(IconFontFamily));
|
||||
|
||||
public FontFamily IconFontFamily {
|
||||
get => GetValue(IconFontFamilyProperty);
|
||||
set => SetValue(IconFontFamilyProperty, value);
|
||||
}
|
||||
|
||||
static ChangeStatusIcon() {
|
||||
AffectsRender<ChangeStatusIcon>(IsWorkingCopyChangeProperty, ChangeProperty, IconFontFamilyProperty);
|
||||
AffectsRender<ChangeStatusIcon>(IsWorkingCopyChangeProperty, ChangeProperty);
|
||||
}
|
||||
|
||||
public override void Render(DrawingContext context) {
|
||||
if (Change == null || Bounds.Width <= 0) return;
|
||||
|
||||
var typeface = IconFontFamily == null ? Typeface.Default : new Typeface(IconFontFamily);
|
||||
var typeface = new Typeface("fonts:SourceGit#JetBrains Mono");
|
||||
|
||||
IBrush background = null;
|
||||
string indicator;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue