From 22e576c77543c618d6f2a679e02d063c44ade89a Mon Sep 17 00:00:00 2001 From: cidoku Date: Fri, 10 Oct 2025 23:03:51 -0300 Subject: [PATCH] load courtroom_stylesheets.css --- .../ao2xp_themes/dark/courtroom_stylesheets.css | 16 ++++++++++++++++ AO2XPbase/ao2xp_themes/dark/theme.py | 13 ------------- gameview.py | 9 ++++----- 3 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 AO2XPbase/ao2xp_themes/dark/courtroom_stylesheets.css diff --git a/AO2XPbase/ao2xp_themes/dark/courtroom_stylesheets.css b/AO2XPbase/ao2xp_themes/dark/courtroom_stylesheets.css new file mode 100644 index 0000000..6d4d126 --- /dev/null +++ b/AO2XPbase/ao2xp_themes/dark/courtroom_stylesheets.css @@ -0,0 +1,16 @@ +QWidget#mainWindow, QSlider, QCheckBox, QLabel#lblMusicVolume, +QLabel#lblSoundVolume, QLabel#lblBlipsVolume, QLabel#lblNotMuted, +QLabel#lblMuted, QLabel#lblIniSwapInfo, QLabel#lblPairOffset, +QLabel#lblPairOffsetY, QLabel#lblPairOrder, QWidget#tabLog, +QWidget#tabEvidence, QWidget#tabMute, QWidget#tabIniSwap, +QWidget#tabPair, QWidget#tabMisc, QWidget#tabQueue, QWidget#tabMusic, +QWidget#tabPlayers +{ + color: #eeeeee; + background-color: #111111; +} + +QTextEdit, QLineEdit, QPushButton, QTabWidget, QComboBox, QListWidget, QTreeView { + color: #eeeeee; + background-color: #222222; +} \ No newline at end of file diff --git a/AO2XPbase/ao2xp_themes/dark/theme.py b/AO2XPbase/ao2xp_themes/dark/theme.py index 8240f93..b80c064 100644 --- a/AO2XPbase/ao2xp_themes/dark/theme.py +++ b/AO2XPbase/ao2xp_themes/dark/theme.py @@ -1,17 +1,4 @@ with open(AO2XPpath + "ao2xp_themes/default/theme.py") as t: exec t -self.style = """ - QWidget#mainWindow, QSlider, QCheckBox, QLabel#lblMusicVolume, QLabel#lblSoundVolume, QLabel#lblBlipsVolume, QLabel#lblNotMuted, QLabel#lblMuted, QLabel#lblIniSwapInfo, QLabel#lblPairOffset, QLabel#lblPairOffsetY, QLabel#lblPairOrder, QWidget#tabLog, QWidget#tabEvidence, QWidget#tabMute, QWidget#tabIniSwap, QWidget#tabPair, QWidget#tabMisc, QWidget#tabQueue, QWidget#tabMusic, QWidget#tabPlayers - { - color: #eeeeee; - background: #111111; - } - - QTextEdit, QLineEdit, QPushButton, QTabWidget, QComboBox, QListWidget, QTreeView { - color: #eeeeee; - background: #222222; - } - """ - self.foundSongItemColor = "#444444" \ No newline at end of file diff --git a/gameview.py b/gameview.py index 4079219..d54ec47 100644 --- a/gameview.py +++ b/gameview.py @@ -1607,7 +1607,6 @@ class GUI(QtGui.QWidget): self.sliDemoSeekbar.setVisible(False) self.sliDemoSeekbar.setMinimum(0) - self.style = "" self.gamewindow.setObjectName("mainWindow") self.lblMusicVolume.setObjectName("lblMusicVolume") self.lblSoundVolume.setObjectName("lblSoundVolume") @@ -1710,6 +1709,7 @@ class GUI(QtGui.QWidget): def loadTheme(self, switching=False): theme = getOption("General", "theme", "default") try: + stylesheet = "" self.gamewindow.setStyleSheet("") self.chatbox.resetGeometry() @@ -1759,7 +1759,7 @@ class GUI(QtGui.QWidget): # Theme background courtroomBackground = AO2XPpath + "ao2xp_themes/" + theme + '/courtroombackground.png' if exists(courtroomBackground): - self.style += "QWidget#mainWindow { background-image: url(./" + courtroomBackground + ");}" + stylesheet += "QWidget#mainWindow { background-image: url(./" + courtroomBackground + ");}" courtroomBackground = QtGui.QPixmap(courtroomBackground) self.width = courtroomBackground.size().width() self.height = courtroomBackground.size().height() @@ -1768,9 +1768,8 @@ class GUI(QtGui.QWidget): courtroomStylesheets = AO2XPpath + "ao2xp_themes/" + theme + '/courtroom_stylesheets.css' if exists(courtroomStylesheets): with open(courtroomStylesheets) as f: - self.style += f.read() - self.gamewindow.setStyleSheet(self.style) - self.style = "" + stylesheet += f.read() + self.gamewindow.setStyleSheet(stylesheet) self.presentedEvidence.setGeometry(self.viewport.x() + 16, self.viewport.y() + 16, 70 * self.viewportScale, 70 * self.viewportScale)