mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
theme: add ThemeOverrides.OpacityForNotMergedCommits
to customize the opacity of commits that not belongs (haven't been merged) to current branch in histories (#268)
This commit is contained in:
parent
b2ed1b283a
commit
14469b1399
5 changed files with 22 additions and 16 deletions
|
@ -2,11 +2,18 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
using Avalonia;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
public class Commit
|
||||
{
|
||||
public static double OpacityForNotMerged
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = 0.5;
|
||||
|
||||
public string SHA { get; set; } = string.Empty;
|
||||
public User Author { get; set; } = User.Invalid;
|
||||
public ulong AuthorTime { get; set; } = 0;
|
||||
|
@ -25,5 +32,8 @@ namespace SourceGit.Models
|
|||
|
||||
public bool IsCommitterVisible => !Author.Equals(Committer) || AuthorTime != CommitterTime;
|
||||
public bool IsCurrentHead => Decorators.Find(x => x.Type is DecoratorType.CurrentBranchHead or DecoratorType.CurrentCommitHead) != null;
|
||||
|
||||
public double Opacity => IsMerged ? 1 : OpacityForNotMerged;
|
||||
public FontWeight FontWeight => IsCurrentHead ? FontWeight.Bold : FontWeight.Regular;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue