fix: left side by layout did not update after size changed

This commit is contained in:
leo 2024-07-26 16:32:48 +08:00
parent c83b1fb145
commit b084ee5168
No known key found for this signature in database
2 changed files with 7 additions and 3 deletions

View file

@ -154,7 +154,7 @@
</TextBox.InnerRightContent>
</TextBox>
<Grid Grid.Row="2" x:Name="LeftSidebarGroups" Margin="0,4,0,0" RowDefinitions="28,Auto,28,Auto,28,Auto,28,Auto,28,Auto">
<Grid Grid.Row="2" x:Name="LeftSidebarGroups" Margin="0,4,0,0" RowDefinitions="28,Auto,28,Auto,28,Auto,28,Auto,28,Auto" SizeChanged="OnLeftSidebarSizeChanged">
<!-- Local Branches -->
<ToggleButton Grid.Row="0" Classes="group_expander" IsChecked="{Binding IsLocalBranchGroupExpanded, Mode=TwoWay}">
<TextBlock Classes="group_header_label" Margin="0" Text="{DynamicResource Text.Repository.LocalBranches}"/>

View file

@ -144,9 +144,13 @@ namespace SourceGit.Views
private void OnLeftSidebarDataGridPropertyChanged(object _, AvaloniaPropertyChangedEventArgs e)
{
if (e.Property == DataGrid.ItemsSourceProperty || e.Property == DataGrid.IsVisibleProperty)
{
UpdateLeftSidebarLayout();
}
}
private void OnLeftSidebarSizeChanged(object _, SizeChangedEventArgs e)
{
if (e.HeightChanged)
UpdateLeftSidebarLayout();
}
private void UpdateLeftSidebarLayout()