load courtroom_stylesheets.css

This commit is contained in:
cidoku 2025-10-10 23:03:51 -03:00
parent 1d41392112
commit 22e576c775
3 changed files with 20 additions and 18 deletions

View File

@ -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;
}

View File

@ -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"

View File

@ -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)