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:
leo 2024-06-19 18:15:32 +08:00
parent 4e44d6a7b1
commit fec2b402e0
No known key found for this signature in database
8 changed files with 35 additions and 30 deletions

View file

@ -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()