mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
optimize<Blame>: only navigate to commit when user clicked the commit SHA
This commit is contained in:
parent
24957b8c86
commit
6e624797ae
2 changed files with 11 additions and 3 deletions
|
@ -88,7 +88,11 @@
|
|||
<Grid x:Name="BG">
|
||||
<Border x:Name="Content" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="0,1,0,0">
|
||||
<StackPanel Orientation="Horizontal" Margin="4,0" MaxWidth="300">
|
||||
<TextBlock Text="{Binding Line.CommitSHA}" Foreground="#FFFFB835"/>
|
||||
<TextBlock>
|
||||
<Hyperlink NavigateUri="{Binding Line.CommitSHA}" RequestNavigate="GotoCommit" Foreground="DarkOrange" ToolTip="GOTO COMMIT">
|
||||
<Run Text="{Binding Line.CommitSHA, Mode=OneWay}"/>
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding Line.Time}" Margin="8,0"/>
|
||||
<TextBlock Text="{Binding Line.Author}" Foreground="#FFFFB835"/>
|
||||
</StackPanel>
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Threading.Tasks;
|
|||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Navigation;
|
||||
|
||||
namespace SourceGit.Views {
|
||||
/// <summary>
|
||||
|
@ -156,12 +157,15 @@ namespace SourceGit.Views {
|
|||
var r = blame.SelectedItem as Record;
|
||||
if (r == null) return;
|
||||
|
||||
Models.Watcher.Get(repo).NavigateTo(r.Line.CommitSHA);
|
||||
|
||||
foreach (var one in Records) {
|
||||
one.IsSelected = one.Line.CommitSHA == r.Line.CommitSHA;
|
||||
}
|
||||
}
|
||||
|
||||
private void GotoCommit(object sender, RequestNavigateEventArgs e) {
|
||||
Models.Watcher.Get(repo).NavigateTo(e.Uri.OriginalString);
|
||||
e.Handled = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
private string repo = null;
|
||||
|
|
Loading…
Reference in a new issue