Skip to content

Commit 1a4d3d0

Browse files
committed
enhance: remember the height/width of commit list and detail panel in histories page (#472)
1 parent 6d92b7f commit 1a4d3d0

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

src/ViewModels/Histories.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,30 @@ public object DetailContext
6161
set => SetProperty(ref _detailContext, value);
6262
}
6363

64+
public GridLength LeftArea
65+
{
66+
get => _leftArea;
67+
set => SetProperty(ref _leftArea, value);
68+
}
69+
70+
public GridLength RightArea
71+
{
72+
get => _rightArea;
73+
set => SetProperty(ref _rightArea, value);
74+
}
75+
76+
public GridLength TopArea
77+
{
78+
get => _topArea;
79+
set => SetProperty(ref _topArea, value);
80+
}
81+
82+
public GridLength BottomArea
83+
{
84+
get => _bottomArea;
85+
set => SetProperty(ref _bottomArea, value);
86+
}
87+
6488
public Histories(Repository repo)
6589
{
6690
_repo = repo;
@@ -800,5 +824,10 @@ private void FillTagMenu(ContextMenu menu, Models.Tag tag)
800824
private Models.Commit _autoSelectedCommit = null;
801825
private long _navigationId = 0;
802826
private object _detailContext = null;
827+
828+
private GridLength _leftArea = new GridLength(1, GridUnitType.Star);
829+
private GridLength _rightArea = new GridLength(1, GridUnitType.Star);
830+
private GridLength _topArea = new GridLength(1, GridUnitType.Star);
831+
private GridLength _bottomArea = new GridLength(1, GridUnitType.Star);
803832
}
804833
}

src/Views/Histories.axaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,19 @@
1010
x:Class="SourceGit.Views.Histories"
1111
x:DataType="vm:Histories"
1212
x:Name="ThisControl">
13-
<v:LayoutableGrid RowDefinitions="*,3,*" ColumnDefinitions="*,3,*"
14-
UseHorizontal="{Binding Source={x:Static vm:Preference.Instance}, Path=UseTwoColumnsLayoutInHistories}">
13+
<v:LayoutableGrid UseHorizontal="{Binding Source={x:Static vm:Preference.Instance}, Path=UseTwoColumnsLayoutInHistories}">
14+
<v:LayoutableGrid.RowDefinitions>
15+
<RowDefinition Height="{Binding TopArea, Mode=TwoWay}"/>
16+
<RowDefinition Height="3"/>
17+
<RowDefinition Height="{Binding BottomArea, Mode=TwoWay}"/>
18+
</v:LayoutableGrid.RowDefinitions>
19+
20+
<v:LayoutableGrid.ColumnDefinitions>
21+
<ColumnDefinition Width="{Binding LeftArea, Mode=TwoWay}"/>
22+
<ColumnDefinition Width="3"/>
23+
<ColumnDefinition Width="{Binding RightArea, Mode=TwoWay}"/>
24+
</v:LayoutableGrid.ColumnDefinitions>
25+
1526
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
1627
<Grid RowDefinitions="24,*">
1728
<!-- Headers -->

0 commit comments

Comments
 (0)