From 1a4d3d00866ae05b69336f985dfae524145b33a0 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 14 Sep 2024 17:22:29 +0800 Subject: [PATCH] enhance: remember the height/width of commit list and detail panel in histories page (#472) --- src/ViewModels/Histories.cs | 29 +++++++++++++++++++++++++++++ src/Views/Histories.axaml | 15 +++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs index 4cdf37eb..662d58fa 100644 --- a/src/ViewModels/Histories.cs +++ b/src/ViewModels/Histories.cs @@ -61,6 +61,30 @@ namespace SourceGit.ViewModels set => SetProperty(ref _detailContext, value); } + public GridLength LeftArea + { + get => _leftArea; + set => SetProperty(ref _leftArea, value); + } + + public GridLength RightArea + { + get => _rightArea; + set => SetProperty(ref _rightArea, value); + } + + public GridLength TopArea + { + get => _topArea; + set => SetProperty(ref _topArea, value); + } + + public GridLength BottomArea + { + get => _bottomArea; + set => SetProperty(ref _bottomArea, value); + } + public Histories(Repository repo) { _repo = repo; @@ -800,5 +824,10 @@ namespace SourceGit.ViewModels private Models.Commit _autoSelectedCommit = null; private long _navigationId = 0; private object _detailContext = null; + + private GridLength _leftArea = new GridLength(1, GridUnitType.Star); + private GridLength _rightArea = new GridLength(1, GridUnitType.Star); + private GridLength _topArea = new GridLength(1, GridUnitType.Star); + private GridLength _bottomArea = new GridLength(1, GridUnitType.Star); } } diff --git a/src/Views/Histories.axaml b/src/Views/Histories.axaml index 7cc0bea0..3996554d 100644 --- a/src/Views/Histories.axaml +++ b/src/Views/Histories.axaml @@ -10,8 +10,19 @@ x:Class="SourceGit.Views.Histories" x:DataType="vm:Histories" x:Name="ThisControl"> - + + + + + + + + + + + + +