Skip to content

Commit 02799ba

Browse files
committed
ux: repository page layout (#2660)
- Max width of left sidebar & right content page - Min width of left part in `LOCAL CHANGES` page and `STASHES` page Signed-off-by: leo <longshuang@msn.cn>
1 parent ac1ce9b commit 02799ba

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/Views/Repository.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
x:DataType="vm:Repository">
1212
<Grid>
1313
<Grid.ColumnDefinitions>
14-
<ColumnDefinition Width="{Binding Source={x:Static vm:Preferences.Instance}, Path=Layout.RepositorySidebarWidth, Mode=TwoWay}" MinWidth="200" MaxWidth="500"/>
14+
<ColumnDefinition Width="{Binding Source={x:Static vm:Preferences.Instance}, Path=Layout.RepositorySidebarWidth, Mode=TwoWay}" MinWidth="200"/>
1515
<ColumnDefinition Width="3"/>
16-
<ColumnDefinition Width="*"/>
16+
<ColumnDefinition Width="*" MinWidth="200"/>
1717
</Grid.ColumnDefinitions>
1818

1919
<!-- Left Panel -->

src/Views/StashesPage.axaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ private void OnMainLayoutSizeChanged(object sender, SizeChangedEventArgs e)
2222

2323
var layout = ViewModels.Preferences.Instance.Layout;
2424
var width = grid.Bounds.Width;
25-
var maxLeft = width - 304;
25+
var leftWidth = Math.Max(width - 304, 300);
2626

27-
if (layout.StashesLeftWidth.Value - maxLeft > 1.0)
28-
layout.StashesLeftWidth = new GridLength(maxLeft, GridUnitType.Pixel);
27+
if (layout.StashesLeftWidth.Value - leftWidth > 1.0)
28+
layout.StashesLeftWidth = new GridLength(leftWidth, GridUnitType.Pixel);
2929
}
3030

3131
private async void OnStashListKeyDown(object sender, KeyEventArgs e)

src/Views/WorkingCopy.axaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ private void OnMainLayoutSizeChanged(object sender, SizeChangedEventArgs e)
2525

2626
var layout = ViewModels.Preferences.Instance.Layout;
2727
var width = grid.Bounds.Width;
28-
var maxLeft = width - 304;
28+
var leftWidth = Math.Max(width - 304, 300);
2929

30-
if (layout.WorkingCopyLeftWidth.Value - maxLeft > 1.0)
31-
layout.WorkingCopyLeftWidth = new GridLength(maxLeft, GridUnitType.Pixel);
30+
if (layout.WorkingCopyLeftWidth.Value - leftWidth > 1.0)
31+
layout.WorkingCopyLeftWidth = new GridLength(leftWidth, GridUnitType.Pixel);
3232
}
3333

3434
private async void OnOpenAssumeUnchanged(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)