From c7755899a3cef45f74c50e24ca169c85fd12f272 Mon Sep 17 00:00:00 2001 From: karxi Date: Mon, 2 Jan 2017 16:02:53 -0500 Subject: [PATCH] Make right-clicked tabs open convo context menus --- convo.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/convo.py b/convo.py index c4d612b..b9baede 100644 --- a/convo.py +++ b/convo.py @@ -129,6 +129,22 @@ class PesterTabWindow(QtGui.QFrame): # (Not an issue here, but this used to be on a TextArea.) return + def contextMenuEvent(self, event): + #~if event.reason() == QtGui.QContextMenuEvent.Mouse: + tabi = self.tabs.tabAt(event.pos()) + if tabi < 0: + tabi = self.tabs.currentIndex() + for h, i in self.tabIndices.items(): + if i == tabi: + # Our index matches, grab the object using our handle. + convo = self.convos[h] + break + else: + # No matches + return + # Pop up the options menu of the relevant tab. + convo.contextMenuEvent(event) + def closeSoft(self): self.softclose = True self.close()