set background to QMainWidget

This commit is contained in:
cidoku 2025-10-11 17:25:32 -03:00
parent bf6889a957
commit 9fbf2c56e4

View File

@ -1561,6 +1561,7 @@ class GUI(QtGui.QWidget):
# Objections # Objections
self.btnCustomObjection = buttons.CustomObjection(self) self.btnCustomObjection = buttons.CustomObjection(self)
self.btnCustomObjection.clicked.connect(self.ICChatFocus) self.btnCustomObjection.clicked.connect(self.ICChatFocus)
self.btnCustomObjection.setToolTip("Custom objection")
self.btnTakeThat = buttons.Objections(self, 3) self.btnTakeThat = buttons.Objections(self, 3)
self.btnTakeThat.clicked.connect(self.ICChatFocus) self.btnTakeThat.clicked.connect(self.ICChatFocus)
self.btnTakeThat.setToolTip("Take that!") self.btnTakeThat.setToolTip("Take that!")
@ -1720,6 +1721,8 @@ class GUI(QtGui.QWidget):
self.gamewindow.setStyleSheet("") self.gamewindow.setStyleSheet("")
self.chatbox.resetGeometry() self.chatbox.resetGeometry()
self.btnReloadTheme.setVisible(False) self.btnReloadTheme.setVisible(False)
self.cbBench.setVisible(True)
self.cbSlide.setVisible(True)
self.btnRealization.setPixmaps(theme) self.btnRealization.setPixmaps(theme)
self.btnShake.setPixmaps(theme) self.btnShake.setPixmaps(theme)
@ -1754,6 +1757,10 @@ class GUI(QtGui.QWidget):
"effects_dropdown": self.boxEffects, "effects_dropdown": self.boxEffects,
"pos_dropdown": self.boxPositions, "pos_dropdown": self.boxPositions,
"text_color": self.boxColors, "text_color": self.boxColors,
"pre": self.cbPreanim,
"flip": self.cbFlip,
"additive": self.cbAdditive,
"slide_enable": self.cbSlide,
"pre_no_interrupt": self.cbNoInterrupt, "pre_no_interrupt": self.cbNoInterrupt,
"change_character": self.btnChangeChar, "change_character": self.btnChangeChar,
"call_mod": self.btnCallMod, "call_mod": self.btnCallMod,
@ -1764,14 +1771,10 @@ class GUI(QtGui.QWidget):
"ao2_ic_chat_message": self.ICChatInput, "ao2_ic_chat_message": self.ICChatInput,
"message": self.text, "message": self.text,
"showname": self.name, "showname": self.name,
"music_list": self.serverTabs "music_list": self.serverTabs,
} }
move = { move = {
"pre": self.cbPreanim,
"flip": self.cbFlip,
"additive": self.cbAdditive,
"slide_enable": self.cbSlide,
"hold_it": self.btnHoldIt, "hold_it": self.btnHoldIt,
"objection": self.btnObjection, "objection": self.btnObjection,
"take_that": self.btnTakeThat, "take_that": self.btnTakeThat,
@ -1816,7 +1819,12 @@ class GUI(QtGui.QWidget):
if "found_song_color" in design: if "found_song_color" in design:
self.foundSongItemColor = QtGui.QColor(*[int(x) for x in design["found_song_color"]]) self.foundSongItemColor = QtGui.QColor(*[int(x) for x in design["found_song_color"]])
self.cbSlide.setVisible("slide_enable" in design)
self.cbBench.setVisible("ao2xp_desk" in design)
self.btnReloadTheme.setVisible(True) self.btnReloadTheme.setVisible(True)
# TODO: Load script common to all themes
else: else:
# Try to load ao2xp theme # Try to load ao2xp theme
pass pass
@ -1863,7 +1871,7 @@ class GUI(QtGui.QWidget):
# Theme background # Theme background
courtroomBackground = AO2XPpath + "ao2xp_themes/" + theme + '/courtroombackground.png' courtroomBackground = AO2XPpath + "ao2xp_themes/" + theme + '/courtroombackground.png'
if exists(courtroomBackground): if exists(courtroomBackground):
stylesheet += "QWidget#mainWindow { background-image: url(./" + courtroomBackground + ");}" stylesheet += "QMainWindow { background-image: url(./" + courtroomBackground + ");}"
courtroomBackground = QtGui.QPixmap(courtroomBackground) courtroomBackground = QtGui.QPixmap(courtroomBackground)
self.width = courtroomBackground.size().width() self.width = courtroomBackground.size().width()
self.height = courtroomBackground.size().height() self.height = courtroomBackground.size().height()