Skip to content

Commit e7d6f35

Browse files
committed
Selected image-diff mode is now persistent
1 parent f013d7f commit e7d6f35

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/ViewModels/Preferences.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,12 @@ public int LFSImageActiveIdx
279279
set => SetProperty(ref _lfsImageActiveIdx, value);
280280
}
281281

282+
public int ImageDiffActiveIdx
283+
{
284+
get => _imageDiffActiveIdx;
285+
set => SetProperty(ref _imageDiffActiveIdx, value);
286+
}
287+
282288
public bool EnableCompactFoldersInChangesTree
283289
{
284290
get => _enableCompactFoldersInChangesTree;
@@ -736,6 +742,7 @@ private bool RemoveInvalidRepositoriesRecursive(List<RepositoryNode> collection)
736742
private bool _showHiddenSymbolsInDiffView = false;
737743
private bool _useFullTextDiff = false;
738744
private int _lfsImageActiveIdx = 0;
745+
private int _imageDiffActiveIdx = 0;
739746
private bool _enableCompactFoldersInChangesTree = false;
740747

741748
private Models.ChangeViewMode _unstagedChangeViewMode = Models.ChangeViewMode.List;

src/Views/ImageDiffView.axaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:m="using:SourceGit.Models"
6+
xmlns:vm="using:SourceGit.ViewModels"
67
xmlns:v="using:SourceGit.Views"
78
xmlns:c="using:SourceGit.Converters"
89
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
910
x:Class="SourceGit.Views.ImageDiffView"
1011
x:DataType="m:ImageDiff">
11-
<TabControl Margin="0,0,0,8" TabStripPlacement="Bottom">
12+
<TabControl SelectedIndex="{Binding Source={x:Static vm:Preferences.Instance}, Path=ImageDiffActiveIdx, Mode=TwoWay}" Margin="0,0,0,8" TabStripPlacement="Bottom">
1213
<TabControl.Styles>
1314
<Style Selector="TabControl /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel">
1415
<Setter Property="HorizontalAlignment" Value="Center"/>

0 commit comments

Comments
 (0)