Skip to content

Commit

Permalink
ux: adjust column width of commit hash and time after font size chang…
Browse files Browse the repository at this point in the history
…ed (#994)

Signed-off-by: leo <longshuang@msn.cn>
  • Loading branch information
love-linger committed Mar 6, 2025
1 parent 78c0d8d commit aa0d4b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/Views/Histories.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</v:LayoutableGrid.ColumnDefinitions>

<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
<Grid RowDefinitions="24,*">
<Grid RowDefinitions="24,*" Grid.IsSharedSizeScope="True">
<!-- Headers -->
<Border Grid.Row="0"
Background="{DynamicResource Brush.Window}"
Expand All @@ -35,8 +35,8 @@
<ColumnDefinition Width="*" MinWidth="100"/>
<ColumnDefinition Width="3"/>
<ColumnDefinition Width="{Binding #ThisControl.AuthorNameColumnWidth, Mode=TwoWay}" MinWidth="80"/>
<ColumnDefinition Width="100" MaxWidth="100" MinWidth="100"/>
<ColumnDefinition Width="170" MaxWidth="170" MinWidth="170"/>
<ColumnDefinition SharedSizeGroup="SHA"/>
<ColumnDefinition SharedSizeGroup="Time"/>
</Grid.ColumnDefinitions>

<TextBlock Grid.Column="0" Classes="table_header" Text="{DynamicResource Text.Histories.Header.GraphAndSubject}" HorizontalAlignment="Center"/>
Expand Down Expand Up @@ -121,8 +121,8 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="{Binding #ThisControl.AuthorNameColumnWidth, Mode=OneWay}"/>
<ColumnDefinition Width="100" MaxWidth="100" MinWidth="100"/>
<ColumnDefinition Width="170" MaxWidth="170" MinWidth="170"/>
<ColumnDefinition SharedSizeGroup="SHA" Width="Auto" MinWidth="100"/>
<ColumnDefinition SharedSizeGroup="Time" Width="Auto" MinWidth="160"/>
</Grid.ColumnDefinitions>

<!-- Subject & REFS -->
Expand Down
22 changes: 19 additions & 3 deletions src/Views/InteractiveRebase.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
SelectionMode="Single"
SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto">
ScrollViewer.VerticalScrollBarVisibility="Auto"
Grid.IsSharedSizeScope="True">
<v:InteractiveRebaseListBox.Styles>
<Style Selector="ListBoxItem">
<Setter Property="Margin" Value="0"/>
Expand All @@ -78,7 +79,19 @@

<v:InteractiveRebaseListBox.ItemTemplate>
<DataTemplate DataType="vm:InteractiveRebaseItem">
<Grid Height="26" Margin="8,0" ColumnDefinitions="16,110,*,32,108,96,170,32,32" ClipToBounds="True">
<Grid Height="26" Margin="8,0" ClipToBounds="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="16"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="32"/>
<ColumnDefinition Width="108"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="CommitHashColumn"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="CommitTimeColumn"/>
<ColumnDefinition Width="32"/>
<ColumnDefinition Width="32"/>
</Grid.ColumnDefinitions>

<!-- Drag & Drop Anchor -->
<Border Grid.Column="0" Background="Transparent"
Loaded="OnSetupRowHeaderDragDrop"
Expand Down Expand Up @@ -210,7 +223,10 @@

<!-- Commit Time -->
<Border Grid.Column="6">
<TextBlock Classes="primary" Text="{Binding Commit.CommitterTimeStr}" HorizontalAlignment="Center"/>
<TextBlock Classes="primary"
Margin="16,0,8,0"
Text="{Binding Commit.CommitterTimeStr}"
HorizontalAlignment="Center"/>
</Border>

<!-- MoveUp Button -->
Expand Down

0 comments on commit aa0d4b4

Please sign in to comment.