mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 12:45:00 +00:00
fix: MinWidth not work while manually resizing window (#619)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
ee20eba047
commit
5c92fbdb37
4 changed files with 30 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue