mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-01 01:14:59 +00:00
optimize<CommitViewer>: use d=404 instead of d=mp to get avatar from gravatar.com
This commit is contained in:
parent
60254e15ad
commit
400b8c3af5
4 changed files with 11 additions and 4 deletions
|
@ -36,12 +36,16 @@
|
|||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="96"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Width="64" Height="64" HorizontalAlignment="Right" Background="Gray">
|
||||
<Path Style="{StaticResource Style.Icon}" Width="56" Height="56" Data="{StaticResource Icon.User}" VerticalAlignment="Bottom"/>
|
||||
</Border>
|
||||
|
||||
<Image Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Width="64" Height="64" x:Name="authorAvatar" HorizontalAlignment="Right"/>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Margin="15,0,0,0" Text="AUTHOR" Opacity=".6" Foreground="{StaticResource Brush.FG}"/>
|
||||
|
@ -65,6 +69,10 @@
|
|||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Width="64" Height="64" HorizontalAlignment="Right" Background="Gray">
|
||||
<Path Style="{StaticResource Style.Icon}" Width="56" Height="56" Data="{StaticResource Icon.User}" VerticalAlignment="Bottom"/>
|
||||
</Border>
|
||||
|
||||
<Image Grid.Row="0" Grid.RowSpan="3" Grid.Column="0" Width="64" Height="64" x:Name="committerAvatar" HorizontalAlignment="Right"/>
|
||||
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Margin="15,0,0,0" Text="COMMITTER" Opacity=".6" Foreground="{StaticResource Brush.FG}"/>
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace SourceGit.UI {
|
|||
if (File.Exists(filePath)) {
|
||||
img.Source = new BitmapImage(new Uri(filePath));
|
||||
} else {
|
||||
var bitmap = new BitmapImage(new Uri("https://www.gravatar.com/avatar/" + md5 + "?d=mp"));
|
||||
var bitmap = new BitmapImage(new Uri("https://www.gravatar.com/avatar/" + md5 + "?d=404"));
|
||||
if (save) {
|
||||
bitmap.DownloadCompleted += (o, e) => {
|
||||
var owner = o as BitmapImage;
|
||||
|
|
|
@ -448,8 +448,6 @@ namespace SourceGit.UI {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Prevent default auto-scrolling when click row in DataGrid.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue