mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
feature: add +
/-
in line number to indicate type of change (#593)
This commit is contained in:
parent
06fd49ba92
commit
f6e1e65a53
1 changed files with 27 additions and 1 deletions
|
@ -105,6 +105,32 @@ namespace SourceGit.Views
|
|||
continue;
|
||||
|
||||
var y = line.GetTextLineVisualYPosition(line.TextLines[0], VisualYPosition.LineMiddle) - view.VerticalOffset;
|
||||
|
||||
var prefix = null as FormattedText;
|
||||
if (info.Type == Models.TextDiffLineType.Added)
|
||||
{
|
||||
prefix = new FormattedText(
|
||||
"+",
|
||||
CultureInfo.CurrentCulture,
|
||||
FlowDirection.LeftToRight,
|
||||
typeface,
|
||||
presenter.FontSize,
|
||||
Brushes.Green);
|
||||
}
|
||||
else if (info.Type == Models.TextDiffLineType.Deleted)
|
||||
{
|
||||
prefix = new FormattedText(
|
||||
"-",
|
||||
CultureInfo.CurrentCulture,
|
||||
FlowDirection.LeftToRight,
|
||||
typeface,
|
||||
presenter.FontSize,
|
||||
Brushes.Red);
|
||||
}
|
||||
|
||||
if (prefix != null)
|
||||
context.DrawText(prefix, new Point(0, y - prefix.Height * 0.5));
|
||||
|
||||
var txt = new FormattedText(
|
||||
lineNumber,
|
||||
CultureInfo.CurrentCulture,
|
||||
|
@ -126,7 +152,7 @@ namespace SourceGit.Views
|
|||
var maxLineNumber = presenter.GetMaxLineNumber();
|
||||
var typeface = TextView.CreateTypeface();
|
||||
var test = new FormattedText(
|
||||
$"{maxLineNumber}",
|
||||
$"- {maxLineNumber}",
|
||||
CultureInfo.CurrentCulture,
|
||||
FlowDirection.LeftToRight,
|
||||
typeface,
|
||||
|
|
Loading…
Reference in a new issue