mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
code_review: PR #187
* replace icon with common whitespace icon in other editors * button tooltip translations * rename `_showHiddenSymbols` to `_showHiddenSymbolsInDiffView` to make its usage clear * change the order of this button
This commit is contained in:
parent
4e44d6a7b1
commit
fec2b402e0
8 changed files with 35 additions and 30 deletions
|
@ -105,16 +105,15 @@ namespace SourceGit.Views
|
|||
set => SetValue(UseSyntaxHighlightingProperty, value);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ShowHiddenSymbols StyledProperty definition
|
||||
/// </summary>
|
||||
public static readonly StyledProperty<bool> ShowHiddenSymbolsProperty =
|
||||
AvaloniaProperty.Register<IThemedTextDiffPresenter, bool>(nameof(ShowHiddenSymbols));
|
||||
AvaloniaProperty.Register<IThemedTextDiffPresenter, bool>(nameof(ShowHiddenSymbols), false);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the ShowHiddenSymbols property. This StyledProperty
|
||||
/// indicates thath show hidden symbol like space and tab
|
||||
/// indicates that show hidden symbol like space and tab
|
||||
/// </summary>
|
||||
public bool ShowHiddenSymbols
|
||||
{
|
||||
|
@ -157,17 +156,23 @@ namespace SourceGit.Views
|
|||
base.OnPropertyChanged(change);
|
||||
|
||||
if (change.Property == UseSyntaxHighlightingProperty)
|
||||
UpdateTextMate();
|
||||
else if(change.Property == ShowHiddenSymbolsProperty)
|
||||
{
|
||||
var showHiddenSymbols = change.NewValue is true;
|
||||
this.Options.ShowTabs = showHiddenSymbols;
|
||||
this.Options.ShowSpaces = showHiddenSymbols;
|
||||
UpdateTextMate();
|
||||
}
|
||||
else if (change.Property == ShowHiddenSymbolsProperty)
|
||||
{
|
||||
var val = change.NewValue is true;
|
||||
Options.ShowTabs = val;
|
||||
Options.ShowSpaces = val;
|
||||
}
|
||||
else if (change.Property == FileNameProperty)
|
||||
{
|
||||
Models.TextMateHelper.SetGrammarByFileName(_textMate, FileName);
|
||||
}
|
||||
else if (change.Property.Name == "ActualThemeVariant" && change.NewValue != null)
|
||||
{
|
||||
Models.TextMateHelper.SetThemeByApp(_textMate);
|
||||
}
|
||||
}
|
||||
|
||||
protected void UpdateTextMate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue