From a30ac86617373b36020a4c9a0559001087a5ad4b Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 15 Jul 2020 11:49:16 +0800 Subject: [PATCH] Fix context menu conflicts with commit info popup panel --- SourceGit/UI/Blame.xaml.cs | 5 ++++- SourceGit/UI/Dashboard.xaml | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/SourceGit/UI/Blame.xaml.cs b/SourceGit/UI/Blame.xaml.cs index 8f4bc3c0..8d3f8b55 100644 --- a/SourceGit/UI/Blame.xaml.cs +++ b/SourceGit/UI/Blame.xaml.cs @@ -84,7 +84,9 @@ namespace SourceGit.UI { p.Background = BG[i % 2]; p.Foreground = FindResource("Brush.FG") as SolidColorBrush; p.FontStyle = FontStyles.Normal; - p.MouseRightButtonDown += (sender, ev) => { + p.ContextMenuOpening += (sender, ev) => { + if (!content.Selection.IsEmpty) return; + Hyperlink link = new Hyperlink(new Run(frag.CommitSHA)); link.ToolTip = "CLICK TO GO"; link.Click += (o, e) => { @@ -105,6 +107,7 @@ namespace SourceGit.UI { authorName.Content = frag.Author; authorTime.Content = frag.Time; popup.IsOpen = true; + ev.Handled = true; }; var formatter = new FormattedText( diff --git a/SourceGit/UI/Dashboard.xaml b/SourceGit/UI/Dashboard.xaml index 6f1ca2de..c7c3b988 100644 --- a/SourceGit/UI/Dashboard.xaml +++ b/SourceGit/UI/Dashboard.xaml @@ -5,7 +5,6 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:source="clr-namespace:SourceGit" xmlns:local="clr-namespace:SourceGit.UI" - xmlns:git="clr-namespace:SourceGit.Git" xmlns:converters="clr-namespace:SourceGit.Converters" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"