diff src/changesetitem.cpp @ 474:8bdc8f27d19c

Use contextMenuEvent instead of right-click in mousePressEvent to call up changeset item context menu. Appears to fix #201, though I'm cautious as I don't understand the reason
author Chris Cannam
date Tue, 26 Jul 2011 13:41:56 +0100
parents e43fc86506d1
children 470829a21f98
line wrap: on
line diff
--- a/src/changesetitem.cpp	Thu Jul 14 13:56:20 2011 +0100
+++ b/src/changesetitem.cpp	Tue Jul 26 13:41:56 2011 +0100
@@ -101,17 +101,16 @@
         } else {
             showDetail();
         }
-    } else if (e->button() == Qt::RightButton) {
-        if (m_detail) {
-            hideDetail();
-        }
-        activateMenu();
     }
 }
 
 void
-ChangesetItem::activateMenu()
+ChangesetItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *)
 {
+    if (m_detail) {
+        hideDetail();
+    }
+
     m_parentDiffActions.clear();
     m_summaryActions.clear();
 
@@ -201,9 +200,9 @@
     QAction *tag = menu->addAction(tr("Add tag..."));
     connect(tag, SIGNAL(triggered()), this, SLOT(tagActivated()));
 
+    ungrabMouse();
+
     menu->exec(QCursor::pos());
-
-    ungrabMouse();
 }
 
 void