Skip to content

Commit f022ac2

Browse files
committed
ux: layout for SHA and TIME column in HISTORY page
Signed-off-by: leo <[email protected]>
1 parent 1af05b3 commit f022ac2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Views/CommitTimeTextBlock.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Avalonia;
44
using Avalonia.Controls;
55
using Avalonia.Interactivity;
6+
using Avalonia.Layout;
67
using Avalonia.Threading;
78

89
namespace SourceGit.Views
@@ -51,9 +52,15 @@ protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs chang
5152
SetCurrentValue(TextProperty, GetDisplayText());
5253

5354
if (ShowAsDateTime)
55+
{
5456
StopTimer();
57+
HorizontalAlignment = HorizontalAlignment.Left;
58+
}
5559
else
60+
{
5661
StartTimer();
62+
HorizontalAlignment = HorizontalAlignment.Center;
63+
}
5764
}
5865
else if (change.Property == DateTimeFormatProperty)
5966
{

src/Views/Histories.axaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
User="{Binding Author}"
179179
Opacity="{Binding Opacity}"/>
180180

181-
<Border Grid.Column="1" Padding="8,0,0,0" ClipToBounds="True">
181+
<Border Grid.Column="1" Padding="8,0,4,0" ClipToBounds="True">
182182
<TextBlock Classes="primary"
183183
Text="{Binding Author.Name}"
184184
FontWeight="{Binding FontWeight}"
@@ -188,18 +188,16 @@
188188
</Grid>
189189

190190
<!-- SHA -->
191-
<Border Grid.Column="2" Padding="4,0" IsHitTestVisible="False" ClipToBounds="True">
191+
<Border Grid.Column="2" Padding="8,0,0,0" IsHitTestVisible="False" ClipToBounds="True">
192192
<TextBlock Classes="primary"
193193
Text="{Binding SHA, Converter={x:Static c:StringConverters.ToShortSHA}}"
194-
HorizontalAlignment="Center"
195194
FontWeight="{Binding FontWeight}"
196195
Opacity="{Binding Opacity}"/>
197196
</Border>
198197

199198
<!-- TIME -->
200-
<Border Grid.Column="3" Padding="4,0,8,0" ClipToBounds="True" IsHitTestVisible="False">
199+
<Border Grid.Column="3" Padding="8,0" ClipToBounds="True" IsHitTestVisible="False">
201200
<v:CommitTimeTextBlock Classes="primary"
202-
HorizontalAlignment="Center"
203201
FontWeight="{Binding FontWeight}"
204202
Opacity="{Binding Opacity}"
205203
UseAuthorTime="{Binding Source={x:Static vm:Preferences.Instance}, Path=ShowAuthorTimeInGraph, Mode=OneWay}"

0 commit comments

Comments
 (0)