fix(ui): line up the backup dialog columns again (#10302)

#10292 made the label and button columns of the backup view Auto with
a minimum width, so that longer labels and buttons fit. Each of the two
cards sizes its own grid, so when the remote (WebDAV) buttons are wider
than the local ones, the local buttons no longer sit under the remote
ones and the separators of the two cards differ in length. This shows
in English and in every other language except Chinese.

Share the column widths of the two cards with SharedSizeGroup: both
cards line up again, and the long labels and buttons still fit. In
Avalonia the buttons stay centred in the shared column; in WPF they
fill it as before, so the local buttons get as wide as the remote ones.
This commit is contained in:
Miheichev Aleksandr Sergeevich
2026-10-07 03:09:32 +00:00
committed by GitHub
parent 771ef3192a
commit fa9d4a4769
2 changed files with 34 additions and 10 deletions
@@ -24,7 +24,7 @@
HorizontalAlignment="Left" />
</StackPanel>
<StackPanel>
<StackPanel Grid.IsSharedSizeScope="True">
<Border
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
@@ -32,8 +32,14 @@
<Grid Margin="{StaticResource Margin4}" RowDefinitions="Auto,Auto,Auto,Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="300" />
<ColumnDefinition Width="Auto" MinWidth="200" />
<ColumnDefinition
Width="Auto"
MinWidth="300"
SharedSizeGroup="BackupLabel" />
<ColumnDefinition
Width="Auto"
MinWidth="200"
SharedSizeGroup="BackupButton" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Row="0"
@@ -82,8 +88,14 @@
Theme="{DynamicResource CardBorder}">
<Grid Margin="{StaticResource Margin4}" RowDefinitions="Auto,Auto,Auto,Auto,Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="300" />
<ColumnDefinition Width="Auto" MinWidth="200" />
<ColumnDefinition
Width="Auto"
MinWidth="300"
SharedSizeGroup="BackupLabel" />
<ColumnDefinition
Width="Auto"
MinWidth="200"
SharedSizeGroup="BackupButton" />
</Grid.ColumnDefinitions>
<StackPanel
Grid.Row="0"
+17 -5
View File
@@ -30,7 +30,7 @@
Style="{StaticResource ToolbarTextBlock}" />
</DockPanel>
<StackPanel>
<StackPanel Grid.IsSharedSizeScope="True">
<materialDesign:Card Width="Auto" Margin="{StaticResource Margin8}">
<Grid Margin="{StaticResource Margin8}">
<Grid.RowDefinitions>
@@ -40,8 +40,14 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="300" />
<ColumnDefinition Width="Auto" MinWidth="200" />
<ColumnDefinition
Width="Auto"
MinWidth="300"
SharedSizeGroup="BackupLabel" />
<ColumnDefinition
Width="Auto"
MinWidth="200"
SharedSizeGroup="BackupButton" />
</Grid.ColumnDefinitions>
<TextBlock
Grid.Row="0"
@@ -98,8 +104,14 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="300" />
<ColumnDefinition Width="Auto" MinWidth="200" />
<ColumnDefinition
Width="Auto"
MinWidth="300"
SharedSizeGroup="BackupLabel" />
<ColumnDefinition
Width="Auto"
MinWidth="200"
SharedSizeGroup="BackupButton" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<TextBlock