diff --git a/src/Resources/Icons.axaml b/src/Resources/Icons.axaml index bcaaf15b..e818c8d0 100644 --- a/src/Resources/Icons.axaml +++ b/src/Resources/Icons.axaml @@ -101,5 +101,5 @@ M832 464h-68V240a128 128 0 00-128-128h-248a128 128 0 00-128 128v224H192c-18 0-32 14-32 32v384c0 18 14 32 32 32h640c18 0 32-14 32-32v-384c0-18-14-32-32-32zm-292 237v53a8 8 0 01-8 8h-40a8 8 0 01-8-8v-53a48 48 0 1156 0zm152-237H332V240a56 56 0 0156-56h248a56 56 0 0156 56v224z M832 464H332V240c0-31 25-56 56-56h248c31 0 56 25 56 56v68c0 4 4 8 8 8h56c4 0 8-4 8-8v-68c0-71-57-128-128-128H388c-71 0-128 57-128 128v224h-68c-18 0-32 14-32 32v384c0 18 14 32 32 32h640c18 0 32-14 32-32V496c0-18-14-32-32-32zM540 701v53c0 4-4 8-8 8h-40c-4 0-8-4-8-8v-53c-12-9-20-23-20-39 0-27 22-48 48-48s48 22 48 48c0 16-8 30-20 39z M897 673v13c0 51-42 93-93 93h-10c-1 0-2 0-2 0H220c-23 0-42 19-42 42v13c0 23 19 42 42 42h552c14 0 26 12 26 26 0 14-12 26-26 26H220c-51 0-93-42-93-93v-13c0-51 42-93 93-93h20c1-0 2-0 2-0h562c23 0 42-19 42-42v-13c0-11-5-22-13-29-8-7-17-11-28-10H660c-14 0-26-12-26-26 0-14 12-26 26-26h144c24-1 47 7 65 24 18 17 29 42 29 67zM479 98c-112 0-203 91-203 203 0 44 14 85 38 118l132 208c15 24 50 24 66 0l133-209c23-33 37-73 37-117 0-112-91-203-203-203zm0 327c-68 0-122-55-122-122s55-122 122-122 122 55 122 122-55 122-122 122z - m 319.21875,-801.79687 c -62.76888,0 -119.97164,17.53932 -171.5625,52.57812 -51.590859,35.0388 -88.971614,81.95982 -112.1875,140.85938 23.215886,58.89955 60.596641,105.89871 112.1875,140.9375 51.59086,35.03879 108.79362,52.57812 171.5625,52.57812 62.76888,0 119.97164,-17.53933 171.5625,-52.57812 51.59086,-35.03879 88.97162,-82.03795 112.1875,-140.9375 -23.21588,-58.89956 -60.59664,-105.82058 -112.1875,-140.85938 -51.59086,-35.0388 -108.79362,-52.57812 -171.5625,-52.57812 z m 0,51.5625 c 48.58139,0 93.20033,12.85703 133.82812,38.4375 40.6278,25.58047 71.70694,60.0152 93.20313,103.4375 -21.49619,43.42229 -52.57533,77.93516 -93.20313,103.51562 -40.62779,25.58047 -85.24673,38.35938 -133.82812,38.35938 -48.58139,0 -93.20033,-12.77891 -133.82812,-38.35938 -40.6278,-25.58046 -71.70694,-60.09333 -93.20313,-103.51562 21.49619,-43.4223 52.57533,-77.85703 93.20313,-103.4375 40.62779,-25.58047 85.24673,-38.4375 133.82812,-38.4375 z m 0,25.85937 c -32.24429,0 -59.6165,11.25712 -82.1875,33.82813 -22.571,22.571 -33.90625,49.94321 -33.90625,82.1875 0,32.24428 11.33525,59.69462 33.90625,82.26562 22.571,22.571 49.94321,33.82813 82.1875,33.82813 32.24429,0 59.6165,-11.25713 82.1875,-33.82813 22.571,-22.571 33.90625,-50.02134 33.90625,-82.26562 0,-32.24429 -11.33525,-59.6165 -33.90625,-82.1875 -22.571,-22.57101 -49.94321,-33.82813 -82.1875,-33.82813 z m 0,46.40625 c 19.34657,0 35.75428,6.76991 49.29688,20.3125 13.54259,13.5426 20.3125,29.9503 20.3125,49.29688 0,19.34657 -6.76991,35.8324 -20.3125,49.375 -13.5426,13.5426 -29.95031,20.3125 -49.29688,20.3125 -19.34657,0 -35.75428,-6.7699 -49.29688,-20.3125 -13.54259,-13.5426 -20.31249,-30.02843 -20.3125,-49.375 0,-19.34658 6.76991,-35.75428 20.3125,-49.29688 13.5426,-13.54259 29.95031,-20.3125 49.29688,-20.3125 z m 458.04688,93.82813 v 193.04687 H 599.53125 v -85.54687 L 440.3125,-317.42187 599.53125,-158.20312 V -243.75 h 324.6875 l 0.3125,-340.39062 z + M416 64H768v64h-64v704h64v64H448v-64h64V512H416a224 224 0 1 1 0-448zM576 832h64V128H576v704zM416 128H512v320H416a160 160 0 0 1 0-320z diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 58f7ccb8..5971af6c 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -171,7 +171,7 @@ Decrease Number of Visible Lines Increase Number of Visible Lines SELECT FILE TO VIEW CHANGES - Show hidden symbols(space, tab) + Show hidden symbols Open In Merge Tool Discard Changes All local changes in working copy. diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 10a75ee0..a6189e27 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -174,7 +174,7 @@ 减少可见的行数 增加可见的行数 请选择需要对比的文件 - 显示隐藏符号(空格、制表符) + 显示隐藏符号 使用外部比对工具查看 放弃更改确认 所有本地址未提交的修改。 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index be7cf16c..96c1535a 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -174,7 +174,7 @@ 減少可見的行數 增加可見的行數 請選擇需要對比的檔案 - 顯示隱藏符號(空格、製表符 + 顯示隱藏符號 使用外部比對工具檢視 放棄更改確認 所有本地址未提交的修改。 diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 829f268c..0e8b2b37 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -182,6 +182,12 @@ namespace SourceGit.ViewModels set => SetProperty(ref _enableDiffViewWordWrap, value); } + public bool ShowHiddenSymbolsInDiffView + { + get => _showHiddenSymbolsInDiffView; + set => SetProperty(ref _showHiddenSymbolsInDiffView, value); + } + public Models.ChangeViewMode UnstagedChangeViewMode { get => _unstagedChangeViewMode; @@ -320,12 +326,6 @@ namespace SourceGit.ViewModels set; } = 0; - public bool ShowHiddenSymbols - { - get => _showHiddenSymbols; - set => SetProperty(ref _showHiddenSymbols, value); - } - [JsonIgnore] public bool ShouldCheck4UpdateOnStartup { @@ -541,7 +541,7 @@ namespace SourceGit.ViewModels private bool _useSideBySideDiff = false; private bool _useSyntaxHighlighting = false; private bool _enableDiffViewWordWrap = false; - private bool _showHiddenSymbols = false; + private bool _showHiddenSymbolsInDiffView = false; private Models.ChangeViewMode _unstagedChangeViewMode = Models.ChangeViewMode.List; private Models.ChangeViewMode _stagedChangeViewMode = Models.ChangeViewMode.List; diff --git a/src/Views/DiffView.axaml b/src/Views/DiffView.axaml index db3957f5..4e978a43 100644 --- a/src/Views/DiffView.axaml +++ b/src/Views/DiffView.axaml @@ -34,14 +34,6 @@ - - - - @@ -70,6 +62,14 @@ + + + + @@ -43,7 +43,7 @@ FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}" UseSyntaxHighlighting="{Binding Source={x:Static vm:Preference.Instance}, Path=UseSyntaxHighlighting}" WordWrap="{Binding Source={x:Static vm:Preference.Instance}, Path=EnableDiffViewWordWrap}" - ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbols}" + ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbolsInDiffView}" /> @@ -62,7 +62,7 @@ FontFamily="{Binding Source={x:Static vm:Preference.Instance}, Path=MonospaceFont}" UseSyntaxHighlighting="{Binding Source={x:Static vm:Preference.Instance}, Path=UseSyntaxHighlighting}" WordWrap="{Binding Source={x:Static vm:Preference.Instance}, Path=EnableDiffViewWordWrap}" - ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbols}" + ShowHiddenSymbols="{Binding Source={x:Static vm:Preference.Instance}, Path=ShowHiddenSymbolsInDiffView}" /> diff --git a/src/Views/TextDiffView.axaml.cs b/src/Views/TextDiffView.axaml.cs index 1ea10970..ce177d5c 100644 --- a/src/Views/TextDiffView.axaml.cs +++ b/src/Views/TextDiffView.axaml.cs @@ -105,16 +105,15 @@ namespace SourceGit.Views set => SetValue(UseSyntaxHighlightingProperty, value); } - /// /// ShowHiddenSymbols StyledProperty definition /// public static readonly StyledProperty ShowHiddenSymbolsProperty = - AvaloniaProperty.Register(nameof(ShowHiddenSymbols)); + AvaloniaProperty.Register(nameof(ShowHiddenSymbols), false); /// /// 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 /// 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()