mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
refactor<RevisionCompare, Histories>: show author rather than committer in RevisionCompare/Histories
This commit is contained in:
parent
e17fbab4cf
commit
2516f11231
3 changed files with 52 additions and 56 deletions
|
@ -122,8 +122,8 @@
|
||||||
<controls:Avatar
|
<controls:Avatar
|
||||||
Width="16" Height="16"
|
Width="16" Height="16"
|
||||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
Email="{Binding Committer.Email}"
|
Email="{Binding Author.Email}"
|
||||||
FallbackLabel="{Binding Committer.Name}"/>
|
FallbackLabel="{Binding Author.Name}"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
@ -131,7 +131,7 @@
|
||||||
<DataGridTemplateColumn Width="80" IsReadOnly="True">
|
<DataGridTemplateColumn Width="80" IsReadOnly="True">
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Committer.Name}" Margin="0,0,8,0"/>
|
<TextBlock Text="{Binding Author.Name}" Margin="0,0,8,0"/>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<Grid Margin="4,8,4,4">
|
<Grid Margin="4,8,4,4">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="44"/>
|
<RowDefinition Height="48"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
@ -28,33 +28,30 @@
|
||||||
BorderBrush="{DynamicResource Brush.Border2}"
|
BorderBrush="{DynamicResource Brush.Border2}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Background="{DynamicResource Brush.Contents}"
|
Background="{DynamicResource Brush.Contents}"
|
||||||
CornerRadius="4">
|
CornerRadius="4"
|
||||||
<Grid Margin="4">
|
Padding="4"
|
||||||
<Grid.ColumnDefinitions>
|
TextElement.FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}">
|
||||||
<ColumnDefinition Width="Auto"/>
|
<Grid>
|
||||||
<ColumnDefinition Width="*"/>
|
<Grid.RowDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<controls:Avatar Grid.Column="0" Width="32" Height="32" x:Name="avatarStart"/>
|
<Grid Grid.Row="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Column="1" Margin="8,0,0,0">
|
<controls:Avatar Grid.Column="0" Width="14" Height="14" x:Name="avatarStart"/>
|
||||||
<Grid.RowDefinitions>
|
<TextBlock Grid.Column="1" x:Name="txtStartAuthor" Foreground="{DynamicResource Brush.FG1}" Margin="8,0,0,0"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<TextBlock Grid.Column="2" x:Name="txtStartSHA" Foreground="DarkOrange" Margin="8,0,0,0" />
|
||||||
<RowDefinition Height="*"/>
|
<TextBlock Grid.Column="3" x:Name="txtStartTime" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Grid Grid.Row="0">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="0" x:Name="txtStartSHA" Foreground="DarkOrange" FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}"/>
|
|
||||||
<TextBlock Grid.Column="1" x:Name="txtStartTime" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right" FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" x:Name="txtStartSubject" VerticalAlignment="Bottom" FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}" FontSize="10pt"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1" Margin="4,0" x:Name="txtStartSubject" VerticalAlignment="Bottom" FontSize="10pt"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
@ -74,33 +71,30 @@
|
||||||
BorderBrush="{DynamicResource Brush.Border2}"
|
BorderBrush="{DynamicResource Brush.Border2}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
Background="{DynamicResource Brush.Contents}"
|
Background="{DynamicResource Brush.Contents}"
|
||||||
CornerRadius="4">
|
Padding="4"
|
||||||
<Grid Margin="4">
|
CornerRadius="4"
|
||||||
<Grid.ColumnDefinitions>
|
TextElement.FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}">
|
||||||
<ColumnDefinition Width="Auto"/>
|
<Grid>
|
||||||
<ColumnDefinition Width="*"/>
|
<Grid.RowDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<controls:Avatar Grid.Column="0" Width="32" Height="32" x:Name="avatarEnd"/>
|
<Grid Grid.Row="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Column="1" Margin="8,0,0,0">
|
<controls:Avatar Grid.Column="0" Width="14" Height="14" x:Name="avatarEnd"/>
|
||||||
<Grid.RowDefinitions>
|
<TextBlock Grid.Column="1" x:Name="txtEndAuthor" Foreground="{DynamicResource Brush.FG1}" Margin="8,0,0,0"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<TextBlock Grid.Column="2" x:Name="txtEndSHA" Foreground="DarkOrange" Margin="8,0,0,0" />
|
||||||
<RowDefinition Height="*"/>
|
<TextBlock Grid.Column="3" x:Name="txtEndTime" Foreground="{DynamicResource Brush.FG2}" Margin="8,0,0,0"/>
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Grid Grid.Row="0">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Column="0" x:Name="txtEndSHA" Foreground="DarkOrange" FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}" />
|
|
||||||
<TextBlock Grid.Column="1" x:Name="txtEndTime" Foreground="{DynamicResource Brush.FG2}" HorizontalAlignment="Right" FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}" />
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" x:Name="txtEndSubject" VerticalAlignment="Bottom" FontFamily="{Binding Source={x:Static models:Preference.Instance}, Path=General.FontFamilyContent, Mode=OneWay}" FontSize="10pt"/>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="1" Margin="4,0" x:Name="txtEndSubject" VerticalAlignment="Bottom" FontSize="10pt"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -13,16 +13,18 @@ namespace SourceGit.Views.Widgets {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetData(string repo, Models.Commit start, Models.Commit end) {
|
public void SetData(string repo, Models.Commit start, Models.Commit end) {
|
||||||
avatarStart.Email = start.Committer.Email;
|
avatarStart.Email = start.Author.Email;
|
||||||
avatarStart.FallbackLabel = start.Committer.Name;
|
avatarStart.FallbackLabel = start.Author.Name;
|
||||||
avatarStart.ToolTip = start.Committer.Name;
|
avatarStart.ToolTip = start.Committer.Name;
|
||||||
|
txtStartAuthor.Text = start.Author.Name;
|
||||||
txtStartSHA.Text = start.ShortSHA;
|
txtStartSHA.Text = start.ShortSHA;
|
||||||
txtStartTime.Text = start.CommitterTimeStr;
|
txtStartTime.Text = start.CommitterTimeStr;
|
||||||
txtStartSubject.Text = start.Subject;
|
txtStartSubject.Text = start.Subject;
|
||||||
|
|
||||||
avatarEnd.Email = end.Committer.Email;
|
avatarEnd.Email = end.Author.Email;
|
||||||
avatarEnd.FallbackLabel = end.Committer.Name;
|
avatarEnd.FallbackLabel = end.Author.Name;
|
||||||
avatarEnd.ToolTip = end.Committer.Name;
|
avatarEnd.ToolTip = end.Committer.Name;
|
||||||
|
txtEndAuthor.Text = end.Author.Name;
|
||||||
txtEndSHA.Text = end.ShortSHA;
|
txtEndSHA.Text = end.ShortSHA;
|
||||||
txtEndTime.Text = end.CommitterTimeStr;
|
txtEndTime.Text = end.CommitterTimeStr;
|
||||||
txtEndSubject.Text = end.Subject;
|
txtEndSubject.Text = end.Subject;
|
||||||
|
|
Loading…
Reference in a new issue