style<FileHistories>: new style for FileHistories

This commit is contained in:
leo 2023-10-11 11:13:57 +08:00
parent b1f8c93c81
commit e17fbab4cf
2 changed files with 30 additions and 41 deletions

View file

@ -27,6 +27,8 @@ namespace SourceGit.Models {
public string AuthorTimeStr => UTC_START.AddSeconds(AuthorTime).ToString("yyyy-MM-dd HH:mm:ss"); public string AuthorTimeStr => UTC_START.AddSeconds(AuthorTime).ToString("yyyy-MM-dd HH:mm:ss");
public string CommitterTimeStr => UTC_START.AddSeconds(CommitterTime).ToString("yyyy-MM-dd HH:mm:ss"); public string CommitterTimeStr => UTC_START.AddSeconds(CommitterTime).ToString("yyyy-MM-dd HH:mm:ss");
public string AuthorTimeShortStr => UTC_START.AddSeconds(AuthorTime).ToString("yyyy/MM/dd");
public string CommitterTimeShortStr => UTC_START.AddSeconds(CommitterTime).ToString("yyyy/MM/dd");
public static void ParseUserAndTime(string data, ref User user, ref ulong time) { public static void ParseUserAndTime(string data, ref User user, ref ulong time) {
var match = REG_USER_FORMAT.Match(data); var match = REG_USER_FORMAT.Match(data);

View file

@ -60,7 +60,6 @@
<DataGrid <DataGrid
x:Name="commitList" x:Name="commitList"
Grid.Column="0" Grid.Column="0"
Background="{DynamicResource Brush.Contents}"
BorderBrush="{DynamicResource Brush.Border0}" BorderBrush="{DynamicResource Brush.Border0}"
BorderThickness="0,0,1,0" BorderThickness="0,0,1,0"
SelectionMode="Single" SelectionMode="Single"
@ -71,51 +70,39 @@
<DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type models:Commit}"> <DataTemplate DataType="{x:Type models:Commit}">
<Border BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4"> <Border BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="0,0,0,1" Padding="4">
<Grid> <Grid Grid.Column="1" Margin="2,0">
<Grid.ColumnDefinitions> <Grid.RowDefinitions>
<ColumnDefinition Width="36"/> <RowDefinition Height="Auto"/>
<ColumnDefinition Width="*"/> <RowDefinition Height="Auto"/>
</Grid.ColumnDefinitions> </Grid.RowDefinitions>
<controls:Avatar <Grid Grid.Row="0">
Grid.Column="0" <Grid.ColumnDefinitions>
HorizontalAlignment="Center" <ColumnDefinition Width="Auto"/>
Width="32" Height="32" <ColumnDefinition Width="*"/>
Email="{Binding Author.Email}" <ColumnDefinition Width="Auto"/>
FallbackLabel="{Binding Author.Name}" <ColumnDefinition Width="Auto"/>
ToolTip="{Binding Author.Name}"/> </Grid.ColumnDefinitions>
<Grid Grid.Column="1" Margin="8,0,0,0"> <controls:Avatar
<Grid.RowDefinitions> Grid.Column="0"
<RowDefinition Height="Auto"/> HorizontalAlignment="Center"
<RowDefinition Height="Auto"/> Width="14" Height="14"
</Grid.RowDefinitions> Email="{Binding Author.Email}"
FallbackLabel="{Binding Author.Name}"
ToolTip="{Binding Author.Name}"/>
<Grid Grid.Row="0"> <TextBlock Grid.Column="1" Margin="8,0,0,0" Text="{Binding Author.Name}" Foreground="{DynamicResource Brush.FG1}"/>
<Grid.ColumnDefinitions> <TextBlock Grid.Column="3" Margin="8,0,0,0" Text="{Binding AuthorTimeShortStr}" Foreground="{DynamicResource Brush.FG2}"/>
<ColumnDefinition Width="72"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"> <TextBlock Grid.Column="2" Margin="8,0,0,0">
<Hyperlink NavigateUri="{Binding SHA}" RequestNavigate="GotoCommit" Foreground="DarkOrange" ToolTip="GOTO COMMIT"> <Hyperlink NavigateUri="{Binding SHA}" RequestNavigate="GotoCommit" Foreground="DarkOrange" ToolTip="GOTO COMMIT">
<Run Text="{Binding ShortSHA, Mode=OneWay}"/> <Run Text="{Binding ShortSHA, Mode=OneWay}"/>
</Hyperlink> </Hyperlink>
</TextBlock> </TextBlock>
<TextBlock
Grid.Column="1"
Text="{Binding AuthorTimeStr}"
Foreground="{DynamicResource Brush.FG2}"
Margin="4,0,0,0"
HorizontalAlignment="Right"/>
</Grid>
<TextBlock
Grid.Row="1"
Text="{Binding Subject}"
Margin="0,6,0,0"/>
</Grid> </Grid>
<TextBlock Grid.Row="1" Text="{Binding Subject}" Margin="0,6,0,0" FontSize="13"/>
</Grid> </Grid>
</Border> </Border>
</DataTemplate> </DataTemplate>