Fixed floating "PESTERLOGS:" in pesterchum theme.

The background was being applied to QMenu for some reason.
This commit is contained in:
BuildTools 2021-03-26 15:14:58 +01:00
parent a8552ed6ff
commit 70c8b1c1c9
2 changed files with 10 additions and 1 deletions

View file

@ -43,7 +43,7 @@ class PesterIcon(QtGui.QIcon):
class RightClickList(QtWidgets.QListWidget):
def contextMenuEvent(self, event):
#fuckin Qt
#fuckin Qt <--- I feel that </3
if event.reason() == QtGui.QContextMenuEvent.Mouse:
listing = self.itemAt(event.pos())
self.setCurrentItem(listing)

View file

@ -281,6 +281,13 @@ class MemoText(PesterText):
else:
self.setStyleSheet("QTextEdit { %s }" % theme["memos/textarea/style"])
# So it doesn't inherit the memo's background image.
# Fixes floating "PESTERLOG:"
try:
self.setStyleSheet(self.styleSheet() + " QMenu{" + theme["main/defaultwindow/style"] + "}")
except:
pass
def addMessage(self, msg, chum):
if type(msg) in [str, str]:
lexmsg = lexMessage(msg)
@ -400,6 +407,8 @@ class PesterMemo(PesterConvo):
# ban & op list added if we are op
self.optionsMenu = QtWidgets.QMenu(self)
self.optionsMenu.setStyleSheet(self.mainwindow.theme["main/defaultwindow/style"]) # So it doesn't inherit the memo's background image.
# Fixes floating "PESTERLOG:"
self.oocToggle = QtWidgets.QAction(self.mainwindow.theme["main/menus/rclickchumlist/ooc"], self)
self.oocToggle.setCheckable(True)
self.oocToggle.toggled[bool].connect(self.toggleOOC)