transparent backgrounds now?
This commit is contained in:
		
							parent
							
								
									fbaeccdb50
								
							
						
					
					
						commit
						5abf0f2ba0
					
				
							
								
								
									
										182
									
								
								gameview.py
									
									
									
									
									
								
							
							
						
						
									
										182
									
								
								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, |                 move = { | ||||||
|                         "showname": self.name, |                     "pre": self.cbPreanim, | ||||||
|                         "music_list": self.serverTabs, |                     "flip": self.cbFlip, | ||||||
|                     } |                     "additive": self.cbAdditive, | ||||||
|  |                     "slide_enable": self.cbSlide, | ||||||
|  |                     "pre_no_interrupt": self.cbNoInterrupt, | ||||||
|  |                     "hold_it": self.btnHoldIt, | ||||||
|  |                     "objection": self.btnObjection, | ||||||
|  |                     "take_that": self.btnTakeThat, | ||||||
|  |                     "custom_objection": self.btnCustomObjection, | ||||||
|  |                     "emote_left": self.btnPrevEmotePage, | ||||||
|  |                     "emote_right": self.btnNextEmotePage, | ||||||
|  |                     "realization": self.btnRealization, | ||||||
|  |                     "screenshake": self.btnShake, | ||||||
|  |                     "not_guilty": self.btnNotGuilty, | ||||||
|  |                     "guilty": self.btnGuilty, | ||||||
|  |                     "witness_testimony": self.btnWitnessTestimony, | ||||||
|  |                     "cross_examination": self.btnCrossExamination, | ||||||
|  |                 } | ||||||
|  |                  | ||||||
|  |                 bars = { | ||||||
|  |                     "defense_bar": self.btnDefenseBar, | ||||||
|  |                     "prosecution_bar": self.btnProsecutionBar | ||||||
|  |                 } | ||||||
|  |                  | ||||||
|  |                 for e in geometry.keys(): | ||||||
|  |                     if e in design: | ||||||
|  |                         geometry[e].setGeometry(*[int(x) for x in design[e]]) | ||||||
|                      |                      | ||||||
|                     move = { |                 for e in move.keys(): | ||||||
|                         "hold_it": self.btnHoldIt, |                     if e in design: | ||||||
|                         "objection": self.btnObjection, |                         move[e].move(*[int(x) for x in design[e]][0:2]) | ||||||
|                         "take_that": self.btnTakeThat, |  | ||||||
|                         "custom_objection": self.btnCustomObjection, |  | ||||||
|                         "emote_left": self.btnPrevEmotePage, |  | ||||||
|                         "emote_right": self.btnNextEmotePage, |  | ||||||
|                         "realization": self.btnRealization, |  | ||||||
|                         "screenshake": self.btnShake, |  | ||||||
|                         "not_guilty": self.btnNotGuilty, |  | ||||||
|                         "guilty": self.btnGuilty, |  | ||||||
|                         "witness_testimony": self.btnWitnessTestimony, |  | ||||||
|                         "cross_examination": self.btnCrossExamination, |  | ||||||
|                     } |  | ||||||
|                      |                      | ||||||
|                     bars = { |                 for e in bars.keys(): | ||||||
|                         "defense_bar": self.btnDefenseBar, |                     if e in design: | ||||||
|                         "prosecution_bar": self.btnProsecutionBar |                         bars[e].moveBar(*[int(x) for x in design[e]][0:2]) | ||||||
|                     } |                  | ||||||
|  |                 if "emotes" in design: | ||||||
|  |                     self.emotePageGeometry = [int(x) for x in design["emotes"]] | ||||||
|  |                 else: | ||||||
|  |                     self.emotePageGeometry = [0, 0, 0, 0] | ||||||
|                      |                      | ||||||
|                     for e in geometry.keys(): |                 if "emote_button_spacing" in design: | ||||||
|                         if e in design: |                     self.emotePageGeometry += [int(x) for x in design["emote_button_spacing"]] | ||||||
|                             geometry[e].setGeometry(*[int(x) for x in design[e]]) |                 else: | ||||||
|                          |                     self.emotePageGeometry += [1, 1] | ||||||
|                     for e in move.keys(): |  | ||||||
|                         if e in design: |  | ||||||
|                             move[e].move(*[int(x) for x in design[e]][0:2]) |  | ||||||
|                          |  | ||||||
|                     for e in bars.keys(): |  | ||||||
|                         if e in design: |  | ||||||
|                             bars[e].moveBar(*[int(x) for x in design[e]][0:2]) |  | ||||||
|                      |                      | ||||||
|                     if "emotes" in design: |                 if "found_song_color" in design: | ||||||
|                         self.emotePageGeometry = [int(x) for x in design["emotes"]] |                     self.foundSongItemColor = QtGui.QColor(*[int(x) for x in design["found_song_color"]]) | ||||||
|                     else: |  | ||||||
|                         self.emotePageGeometry = [0, 0, 0, 0] |  | ||||||
|                          |  | ||||||
|                     if "emote_button_spacing" in design: |  | ||||||
|                         self.emotePageGeometry += [int(x) for x in design["emote_button_spacing"]] |  | ||||||
|                     else: |  | ||||||
|                         self.emotePageGeometry += [1, 1] |  | ||||||
|                          |  | ||||||
|                     if "found_song_color" in design: |  | ||||||
|                         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) |  | ||||||
|                      |                      | ||||||
|                     # TODO: Load script common to all themes |                 self.cbSlide.setVisible("slide_enable" in design) | ||||||
|  |                 self.cbBench.setVisible("ao2xp_desk" in design)     | ||||||
|  |                 self.btnReloadTheme.setVisible(True) | ||||||
|  |                  | ||||||
|  |                 # 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