This commit is contained in:
恍兮惚兮 2024-05-28 01:06:59 +08:00
parent 545c11984e
commit e688c6a032

View File

@ -94,9 +94,7 @@ class ItemWidget(QWidget):
def mousePressEvent(self, ev) -> None: def mousePressEvent(self, ev) -> None:
try: try:
self.bottommask.setStyleSheet( self.bottommask.setStyleSheet(
"QLabel { background-color: " f'background-color: {globalconfig["dialog_savegame_layout"]["onselectcolor"]};'
+ globalconfig["dialog_savegame_layout"]["onselectcolor"]
+ "; }"
) )
if self != ItemWidget.globallashfocus: if self != ItemWidget.globallashfocus:
@ -107,9 +105,7 @@ class ItemWidget(QWidget):
print_exc() print_exc()
def focusOut(self): def focusOut(self):
self.bottommask.setStyleSheet( self.bottommask.setStyleSheet("background-color: rgba(255,255,255, 0);")
"QLabel { background-color: rgba(255,255,255, 0); }"
)
self.focuschanged.emit(False, self.exe) self.focuschanged.emit(False, self.exe)
def mouseDoubleClickEvent(self, e): def mouseDoubleClickEvent(self, e):
@ -137,6 +133,7 @@ class ItemWidget(QWidget):
# self.setFocusPolicy(Qt.StrongFocus) # self.setFocusPolicy(Qt.StrongFocus)
self.maskshowfileexists = QLabel(self) self.maskshowfileexists = QLabel(self)
self.bottommask = QLabel(self) self.bottommask = QLabel(self)
self.bottommask.setStyleSheet("background-color: rgba(255,255,255, 0);")
layout = QVBoxLayout() layout = QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0) layout.setContentsMargins(0, 0, 0, 0)
self._img = IMGWidget(self.imgw, self.imgh, pixmap) self._img = IMGWidget(self.imgw, self.imgh, pixmap)
@ -158,13 +155,10 @@ class ItemWidget(QWidget):
layout.addWidget(self._lb) layout.addWidget(self._lb)
self.setLayout(layout) self.setLayout(layout)
self.exe = exe self.exe = exe
self.maskshowfileexists.setStyleSheet( c = globalconfig["dialog_savegame_layout"][
"QLabel { background-color: " ("onfilenoexistscolor", "backcolor")[os.path.exists(exe)]
+ globalconfig["dialog_savegame_layout"][ ]
("onfilenoexistscolor", "backcolor")[os.path.exists(exe)] self.maskshowfileexists.setStyleSheet(f"background-color:{c};")
]
+ "; }"
)
class IMGWidget(QLabel): class IMGWidget(QLabel):