Make right-clicked tabs open convo context menus
This commit is contained in:
parent
1989915405
commit
c7755899a3
1 changed files with 16 additions and 0 deletions
16
convo.py
16
convo.py
|
@ -129,6 +129,22 @@ class PesterTabWindow(QtGui.QFrame):
|
||||||
# (Not an issue here, but this used to be on a TextArea.)
|
# (Not an issue here, but this used to be on a TextArea.)
|
||||||
return
|
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):
|
def closeSoft(self):
|
||||||
self.softclose = True
|
self.softclose = True
|
||||||
self.close()
|
self.close()
|
||||||
|
|
Loading…
Reference in a new issue