feature: remember the last active tab index in lfs-image diff view
Some checks are pending
Continuous Integration / Prepare version string (push) Waiting to run
Continuous Integration / Package (push) Blocked by required conditions
Continuous Integration / Build (push) Waiting to run

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-06-05 09:18:19 +08:00
parent f716c5ee1e
commit eebadd67a1
No known key found for this signature in database
2 changed files with 8 additions and 1 deletions

View file

@ -261,6 +261,12 @@ namespace SourceGit.ViewModels
set => SetProperty(ref _useBlockNavigationInDiffView, value); set => SetProperty(ref _useBlockNavigationInDiffView, value);
} }
public int LFSImageDiffActiveIdx
{
get => _lfsImageDiffActiveIdx;
set => SetProperty(ref _lfsImageDiffActiveIdx, value);
}
public Models.ChangeViewMode UnstagedChangeViewMode public Models.ChangeViewMode UnstagedChangeViewMode
{ {
get => _unstagedChangeViewMode; get => _unstagedChangeViewMode;
@ -687,6 +693,7 @@ namespace SourceGit.ViewModels
private bool _showHiddenSymbolsInDiffView = false; private bool _showHiddenSymbolsInDiffView = false;
private bool _useFullTextDiff = false; private bool _useFullTextDiff = false;
private bool _useBlockNavigationInDiffView = false; private bool _useBlockNavigationInDiffView = false;
private int _lfsImageDiffActiveIdx = 0;
private Models.ChangeViewMode _unstagedChangeViewMode = Models.ChangeViewMode.List; private Models.ChangeViewMode _unstagedChangeViewMode = Models.ChangeViewMode.List;
private Models.ChangeViewMode _stagedChangeViewMode = Models.ChangeViewMode.List; private Models.ChangeViewMode _stagedChangeViewMode = Models.ChangeViewMode.List;

View file

@ -282,7 +282,7 @@
<!-- LFS Image Diff --> <!-- LFS Image Diff -->
<DataTemplate DataType="vm:LFSImageDiff"> <DataTemplate DataType="vm:LFSImageDiff">
<TabControl Margin="0,8,0,0"> <TabControl Margin="0,8,0,0" SelectedIndex="{Binding Source={x:Static vm:Preferences.Instance}, Path=LFSImageDiffActiveIdx, Mode=TwoWay}">
<TabControl.Styles> <TabControl.Styles>
<Style Selector="TabControl /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel"> <Style Selector="TabControl /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
<Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center"/>