mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 05:35:00 +00:00
ux: subject length tooltip font size and color
This commit is contained in:
parent
ee6c360dc9
commit
907e009275
3 changed files with 19 additions and 21 deletions
|
@ -31,7 +31,6 @@ namespace SourceGit.Views
|
|||
public TextDocument Document
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public CommitMessageTextBox()
|
||||
|
@ -44,11 +43,8 @@ namespace SourceGit.Views
|
|||
{
|
||||
base.OnPropertyChanged(change);
|
||||
|
||||
if (change.Property == TextProperty)
|
||||
{
|
||||
if (!_isDocumentTextChanging)
|
||||
if (change.Property == TextProperty && !_isDocumentTextChanging)
|
||||
Document.Text = Text;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTextEditorLayoutUpdated(object sender, EventArgs e)
|
||||
|
@ -85,23 +81,18 @@ namespace SourceGit.Views
|
|||
SetCurrentValue(TextProperty, Document.Text);
|
||||
_isDocumentTextChanging = false;
|
||||
|
||||
var setSubject = false;
|
||||
for (int i = 0; i < Document.LineCount; i++)
|
||||
for (var i = 0; i < Document.LineCount; i++)
|
||||
{
|
||||
var line = Document.Lines[i];
|
||||
if (line.LineNumber > 1 && line.Length == 0)
|
||||
{
|
||||
var subject = Text.Substring(0, line.Offset).ReplaceLineEndings(" ").Trim();
|
||||
var subject = Text[..line.Offset].ReplaceLineEndings(" ").Trim();
|
||||
SetCurrentValue(SubjectLengthProperty, subject.Length);
|
||||
setSubject = true;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
_subjectEndLineNumber = line.LineNumber;
|
||||
}
|
||||
|
||||
if (setSubject)
|
||||
return;
|
||||
|
||||
SetCurrentValue(SubjectLengthProperty, Text.ReplaceLineEndings(" ").Trim().Length);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue