diff --git a/src/Views/StashesPage.axaml b/src/Views/StashesPage.axaml index 0b747179..87847c06 100644 --- a/src/Views/StashesPage.axaml +++ b/src/Views/StashesPage.axaml @@ -9,7 +9,7 @@ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="SourceGit.Views.StashesPage" x:DataType="vm:StashesPage"> - + diff --git a/src/Views/StashesPage.axaml.cs b/src/Views/StashesPage.axaml.cs index 60e8f0c1..f3048889 100644 --- a/src/Views/StashesPage.axaml.cs +++ b/src/Views/StashesPage.axaml.cs @@ -9,6 +9,20 @@ namespace SourceGit.Views InitializeComponent(); } + private void OnMainLayoutSizeChanged(object sender, SizeChangedEventArgs e) + { + var grid = sender as Grid; + if (grid == null) + return; + + var layout = ViewModels.Preference.Instance.Layout; + var width = grid.Bounds.Width; + var maxLeft = width - 304; + + if (layout.StashesLeftWidth.Value - maxLeft > 1.0) + layout.StashesLeftWidth = new GridLength(maxLeft, GridUnitType.Pixel); + } + private void OnStashContextRequested(object sender, ContextRequestedEventArgs e) { if (DataContext is ViewModels.StashesPage vm && sender is Border border) diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml index 158268cd..dae1f886 100644 --- a/src/Views/WorkingCopy.axaml +++ b/src/Views/WorkingCopy.axaml @@ -8,7 +8,7 @@ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600" x:Class="SourceGit.Views.WorkingCopy" x:DataType="vm:WorkingCopy"> - + diff --git a/src/Views/WorkingCopy.axaml.cs b/src/Views/WorkingCopy.axaml.cs index 3d615692..f64e1a30 100644 --- a/src/Views/WorkingCopy.axaml.cs +++ b/src/Views/WorkingCopy.axaml.cs @@ -11,6 +11,20 @@ namespace SourceGit.Views InitializeComponent(); } + private void OnMainLayoutSizeChanged(object sender, SizeChangedEventArgs e) + { + var grid = sender as Grid; + if (grid == null) + return; + + var layout = ViewModels.Preference.Instance.Layout; + var width = grid.Bounds.Width; + var maxLeft = width - 304; + + if (layout.WorkingCopyLeftWidth.Value - maxLeft > 1.0) + layout.WorkingCopyLeftWidth = new GridLength(maxLeft, GridUnitType.Pixel); + } + private void OnOpenCommitMessagePicker(object sender, RoutedEventArgs e) { if (sender is Button button && DataContext is ViewModels.WorkingCopy vm)