ux: do not use graph color for commit refs (decorators) in commit details panel

This commit is contained in:
leo 2024-10-15 09:53:22 +08:00
parent 07c2e9f927
commit b44d4d26c9
No known key found for this signature in database
4 changed files with 22 additions and 4 deletions

View file

@ -46,6 +46,15 @@ namespace SourceGit.Views
set => SetValue(ForegroundProperty, value);
}
public static readonly StyledProperty<bool> UseGraphColorProperty =
AvaloniaProperty.Register<CommitRefsPresenter, bool>(nameof(UseGraphColor), false);
public bool UseGraphColor
{
get => GetValue(UseGraphColorProperty);
set => SetValue(UseGraphColorProperty, value);
}
public static readonly StyledProperty<IBrush> TagBackgroundProperty =
AvaloniaProperty.Register<CommitRefsPresenter, IBrush>(nameof(TagBackground), Brushes.White);
@ -122,6 +131,7 @@ namespace SourceGit.Views
var typeface = new Typeface(FontFamily);
var typefaceBold = new Typeface(FontFamily, FontStyle.Normal, FontWeight.Bold);
var fg = Foreground;
var normalBG = UseGraphColor ? commit.Brush : Brushes.Gray;
var tagBG = TagBackground;
var labelSize = FontSize;
var requiredWidth = 0.0;
@ -139,7 +149,13 @@ namespace SourceGit.Views
isHead ? labelSize + 1 : labelSize,
fg);
var item = new RenderItem() { Label = label, Brush = commit.Brush, IsHead = isHead };
var item = new RenderItem()
{
Label = label,
Brush = normalBG,
IsHead = isHead
};
StreamGeometry geo;
switch (decorator.Type)
{