transparent backgrounds now?
This commit is contained in:
parent
fbaeccdb50
commit
5abf0f2ba0
170
gameview.py
170
gameview.py
@ -1712,6 +1712,7 @@ class GUI(QtGui.QWidget):
|
|||||||
self.viewportScale = 1
|
self.viewportScale = 1
|
||||||
self.nameFontPointSize = 12
|
self.nameFontPointSize = 12
|
||||||
self.textFontPointSize = 24
|
self.textFontPointSize = 24
|
||||||
|
self.defaultStyle = QtGui.QApplication.style().objectName()
|
||||||
self.loadTheme()
|
self.loadTheme()
|
||||||
|
|
||||||
def loadTheme(self, switching=False):
|
def loadTheme(self, switching=False):
|
||||||
@ -1724,6 +1725,11 @@ class GUI(QtGui.QWidget):
|
|||||||
self.btnReloadTheme.setVisible(False)
|
self.btnReloadTheme.setVisible(False)
|
||||||
self.cbBench.setVisible(True)
|
self.cbBench.setVisible(True)
|
||||||
self.cbSlide.setVisible(True)
|
self.cbSlide.setVisible(True)
|
||||||
|
for w in [self.gameTabs, self.serverTabs]:
|
||||||
|
stack = w.findChild(QtGui.QStackedWidget)
|
||||||
|
if stack:
|
||||||
|
stack.setAutoFillBackground(False)
|
||||||
|
stack.setAttribute(QtCore.Qt.WA_NoSystemBackground, True)
|
||||||
|
|
||||||
self.btnRealization.setPixmaps(theme)
|
self.btnRealization.setPixmaps(theme)
|
||||||
self.btnShake.setPixmaps(theme)
|
self.btnShake.setPixmaps(theme)
|
||||||
@ -1742,94 +1748,103 @@ class GUI(QtGui.QWidget):
|
|||||||
key, value = keys.split("=")
|
key, value = keys.split("=")
|
||||||
design[key.strip()] = value.replace(" ", "").split(',')
|
design[key.strip()] = value.replace(" ", "").split(',')
|
||||||
|
|
||||||
geometry = {
|
geometry = {
|
||||||
"viewport": self.viewport,
|
"viewport": self.viewport,
|
||||||
"ic_chatlog": self.gameTabs,
|
"ic_chatlog": self.gameTabs,
|
||||||
"server_chatlog": self.OOCLog,
|
"server_chatlog": self.OOCLog,
|
||||||
"ooc_chat_name": self.OOCNameInput,
|
"ooc_chat_name": self.OOCNameInput,
|
||||||
"ooc_chat_message": self.OOCInput,
|
"ooc_chat_message": self.OOCInput,
|
||||||
"music_label": self.lblMusicVolume,
|
"music_label": self.lblMusicVolume,
|
||||||
"sfx_label": self.lblSoundVolume,
|
"sfx_label": self.lblSoundVolume,
|
||||||
"blip_label": self.lblBlipsVolume,
|
"blip_label": self.lblBlipsVolume,
|
||||||
"music_slider": self.sliMusicVolume,
|
"music_slider": self.sliMusicVolume,
|
||||||
"sfx_slider": self.sliSoundVolume,
|
"sfx_slider": self.sliSoundVolume,
|
||||||
"blip_slider": self.sliBlipsVolume,
|
"blip_slider": self.sliBlipsVolume,
|
||||||
"emote_dropdown": self.boxEmotes,
|
"emote_dropdown": self.boxEmotes,
|
||||||
"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,
|
"change_character": self.btnChangeChar,
|
||||||
"flip": self.cbFlip,
|
"call_mod": self.btnCallMod,
|
||||||
"additive": self.cbAdditive,
|
"reload_theme": self.btnReloadTheme,
|
||||||
"slide_enable": self.cbSlide,
|
"ic_chat_name": self.shownameEdit,
|
||||||
"pre_no_interrupt": self.cbNoInterrupt,
|
"settings": self.btnSettings,
|
||||||
"change_character": self.btnChangeChar,
|
"ao2_chatbox": self.chatbox,
|
||||||
"call_mod": self.btnCallMod,
|
"ao2_ic_chat_message": self.ICChatInput,
|
||||||
"reload_theme": self.btnReloadTheme,
|
"message": self.text,
|
||||||
"ic_chat_name": self.shownameEdit,
|
"showname": self.name,
|
||||||
"settings": self.btnSettings,
|
"music_list": self.serverTabs,
|
||||||
"ao2_chatbox": self.chatbox,
|
}
|
||||||
"ao2_ic_chat_message": self.ICChatInput,
|
|
||||||
"message": self.text,
|
|
||||||
"showname": self.name,
|
|
||||||
"music_list": self.serverTabs,
|
|
||||||
}
|
|
||||||
|
|
||||||
move = {
|
move = {
|
||||||
"hold_it": self.btnHoldIt,
|
"pre": self.cbPreanim,
|
||||||
"objection": self.btnObjection,
|
"flip": self.cbFlip,
|
||||||
"take_that": self.btnTakeThat,
|
"additive": self.cbAdditive,
|
||||||
"custom_objection": self.btnCustomObjection,
|
"slide_enable": self.cbSlide,
|
||||||
"emote_left": self.btnPrevEmotePage,
|
"pre_no_interrupt": self.cbNoInterrupt,
|
||||||
"emote_right": self.btnNextEmotePage,
|
"hold_it": self.btnHoldIt,
|
||||||
"realization": self.btnRealization,
|
"objection": self.btnObjection,
|
||||||
"screenshake": self.btnShake,
|
"take_that": self.btnTakeThat,
|
||||||
"not_guilty": self.btnNotGuilty,
|
"custom_objection": self.btnCustomObjection,
|
||||||
"guilty": self.btnGuilty,
|
"emote_left": self.btnPrevEmotePage,
|
||||||
"witness_testimony": self.btnWitnessTestimony,
|
"emote_right": self.btnNextEmotePage,
|
||||||
"cross_examination": self.btnCrossExamination,
|
"realization": self.btnRealization,
|
||||||
}
|
"screenshake": self.btnShake,
|
||||||
|
"not_guilty": self.btnNotGuilty,
|
||||||
|
"guilty": self.btnGuilty,
|
||||||
|
"witness_testimony": self.btnWitnessTestimony,
|
||||||
|
"cross_examination": self.btnCrossExamination,
|
||||||
|
}
|
||||||
|
|
||||||
bars = {
|
bars = {
|
||||||
"defense_bar": self.btnDefenseBar,
|
"defense_bar": self.btnDefenseBar,
|
||||||
"prosecution_bar": self.btnProsecutionBar
|
"prosecution_bar": self.btnProsecutionBar
|
||||||
}
|
}
|
||||||
|
|
||||||
for e in geometry.keys():
|
for e in geometry.keys():
|
||||||
if e in design:
|
if e in design:
|
||||||
geometry[e].setGeometry(*[int(x) for x in design[e]])
|
geometry[e].setGeometry(*[int(x) for x in design[e]])
|
||||||
|
|
||||||
for e in move.keys():
|
for e in move.keys():
|
||||||
if e in design:
|
if e in design:
|
||||||
move[e].move(*[int(x) for x in design[e]][0:2])
|
move[e].move(*[int(x) for x in design[e]][0:2])
|
||||||
|
|
||||||
for e in bars.keys():
|
for e in bars.keys():
|
||||||
if e in design:
|
if e in design:
|
||||||
bars[e].moveBar(*[int(x) for x in design[e]][0:2])
|
bars[e].moveBar(*[int(x) for x in design[e]][0:2])
|
||||||
|
|
||||||
if "emotes" in design:
|
if "emotes" in design:
|
||||||
self.emotePageGeometry = [int(x) for x in design["emotes"]]
|
self.emotePageGeometry = [int(x) for x in design["emotes"]]
|
||||||
else:
|
else:
|
||||||
self.emotePageGeometry = [0, 0, 0, 0]
|
self.emotePageGeometry = [0, 0, 0, 0]
|
||||||
|
|
||||||
if "emote_button_spacing" in design:
|
if "emote_button_spacing" in design:
|
||||||
self.emotePageGeometry += [int(x) for x in design["emote_button_spacing"]]
|
self.emotePageGeometry += [int(x) for x in design["emote_button_spacing"]]
|
||||||
else:
|
else:
|
||||||
self.emotePageGeometry += [1, 1]
|
self.emotePageGeometry += [1, 1]
|
||||||
|
|
||||||
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.cbSlide.setVisible("slide_enable" in design)
|
||||||
self.cbBench.setVisible("ao2xp_desk" in design)
|
self.cbBench.setVisible("ao2xp_desk" in design)
|
||||||
|
self.btnReloadTheme.setVisible(True)
|
||||||
|
|
||||||
self.btnReloadTheme.setVisible(True)
|
# TODO: Load script common to all themes
|
||||||
|
|
||||||
# TODO: Load script common to all themes
|
QtGui.QApplication.setStyle('plastique')
|
||||||
|
for w in [self.gameTabs, self.serverTabs]:
|
||||||
|
stack = w.findChild(QtGui.QStackedWidget)
|
||||||
|
if stack:
|
||||||
|
stack.setAutoFillBackground(False)
|
||||||
|
stack.setAttribute(QtCore.Qt.WA_NoSystemBackground, True)
|
||||||
else:
|
else:
|
||||||
# Try to load ao2xp theme
|
QtGui.QApplication.setStyle(self.defaultStyle)
|
||||||
pass
|
for w in [self.gameTabs, self.serverTabs]:
|
||||||
|
stack = w.findChild(QtGui.QStackedWidget)
|
||||||
|
if stack:
|
||||||
|
stack.setAutoFillBackground(True)
|
||||||
|
stack.setAttribute(QtCore.Qt.WA_NoSystemBackground, False)
|
||||||
|
|
||||||
with open(AO2XPpath + "ao2xp_themes/" + theme + "/theme.py") as t:
|
with open(AO2XPpath + "ao2xp_themes/" + theme + "/theme.py") as t:
|
||||||
exec t
|
exec t
|
||||||
@ -1872,7 +1887,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 += "QMainWindow { background-image: url(./" + courtroomBackground + ");}"
|
stylesheet += "QTabWidget {background-color: transparent;} 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()
|
||||||
@ -1882,6 +1897,7 @@ class GUI(QtGui.QWidget):
|
|||||||
if exists(courtroomStylesheets):
|
if exists(courtroomStylesheets):
|
||||||
with open(courtroomStylesheets) as f:
|
with open(courtroomStylesheets) as f:
|
||||||
stylesheet += f.read()
|
stylesheet += f.read()
|
||||||
|
|
||||||
self.gamewindow.setStyleSheet(stylesheet)
|
self.gamewindow.setStyleSheet(stylesheet)
|
||||||
|
|
||||||
self.presentedEvidence.setGeometry(self.viewport.x() + 16, self.viewport.y() + 16, 70 * self.viewportScale, 70 * self.viewportScale)
|
self.presentedEvidence.setGeometry(self.viewport.x() + 16, self.viewport.y() + 16, 70 * self.viewportScale, 70 * self.viewportScale)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user