This commit is contained in:
恍兮惚兮 2024-06-28 02:14:28 +08:00
parent 47091ea28a
commit a63f2a1cdd
2 changed files with 29 additions and 14 deletions

View File

@ -91,7 +91,7 @@ class ItemWidget(QWidget):
def click(self): def click(self):
try: try:
self.bottommask.setStyleSheet( self.bottommask.setStyleSheet(
f'background-color: {str2rgba(globalconfig["dialog_savegame_layout"]["onselectcolor1"],globalconfig["dialog_savegame_layout"]["transparent"])};' f'background-color: {str2rgba(globalconfig["dialog_savegame_layout"]["onselectcolor1"],globalconfig["dialog_savegame_layout"]["transparentselect"])};'
) )
if self != ItemWidget.globallashfocus: if self != ItemWidget.globallashfocus:
@ -163,7 +163,14 @@ class ItemWidget(QWidget):
os.path.exists(uid2gamepath[gameuid]) os.path.exists(uid2gamepath[gameuid])
] ]
] ]
c = str2rgba(c, globalconfig["dialog_savegame_layout"]["transparent"]) c = str2rgba(
c,
globalconfig["dialog_savegame_layout"][
("transparentnotexits", "transparent")[
os.path.exists(uid2gamepath[gameuid])
]
],
)
self.maskshowfileexists.setStyleSheet(f"background-color:{c};") self.maskshowfileexists.setStyleSheet(f"background-color:{c};")
@ -1546,13 +1553,13 @@ class dialog_syssetting(QDialog):
getspinbox(0, 1000, globalconfig["dialog_savegame_layout"], key), getspinbox(0, 1000, globalconfig["dialog_savegame_layout"], key),
) )
for key, name in [ for key, key2, name in [
("backcolor1", "颜色"), ("backcolor1", "transparent", "颜色"),
("onselectcolor1", "选中时颜色"), ("onselectcolor1", "transparentselect", "选中时颜色"),
("onfilenoexistscolor1", "游戏不存在时颜色"), ("onfilenoexistscolor1", "transparentnotexits", "游戏不存在时颜色"),
]: ]:
formLayout.addRow( formLayout.addRow(
(_TR(name)), _TR(name),
getcolorbutton( getcolorbutton(
globalconfig["dialog_savegame_layout"], globalconfig["dialog_savegame_layout"],
key, key,
@ -1569,10 +1576,10 @@ class dialog_syssetting(QDialog):
parent=self, parent=self,
), ),
) )
formLayout.addRow( formLayout.addRow(
(_TR("不透明度")), _TR(name) + _TR("不透明度"),
getspinbox(0, 100, globalconfig["dialog_savegame_layout"], "transparent"), getspinbox(0, 100, globalconfig["dialog_savegame_layout"], key2),
) )
if type_ == 1: if type_ == 1:
formLayout.addRow( formLayout.addRow(
_TR("缩放"), _TR("缩放"),
@ -2394,9 +2401,8 @@ class clickitem(QWidget):
def click(self): def click(self):
try: try:
self.bottommask.setStyleSheet( self.bottommask.setStyleSheet(
f'background-color: {str2rgba(globalconfig["dialog_savegame_layout"]["onselectcolor1"],globalconfig["dialog_savegame_layout"]["transparent"])};' f'background-color: {str2rgba(globalconfig["dialog_savegame_layout"]["onselectcolor1"],globalconfig["dialog_savegame_layout"]["transparentselect"])};'
) )
if self != clickitem.globallashfocus: if self != clickitem.globallashfocus:
clickitem.clearfocus() clickitem.clearfocus()
clickitem.globallashfocus = self clickitem.globallashfocus = self
@ -2429,7 +2435,14 @@ class clickitem(QWidget):
c = globalconfig["dialog_savegame_layout"][ c = globalconfig["dialog_savegame_layout"][
("onfilenoexistscolor1", "backcolor1")[os.path.exists(uid2gamepath[uid])] ("onfilenoexistscolor1", "backcolor1")[os.path.exists(uid2gamepath[uid])]
] ]
c = str2rgba(c, globalconfig["dialog_savegame_layout"]["transparent"]) c = str2rgba(
c,
globalconfig["dialog_savegame_layout"][
("transparentnotexits", "transparent")[
os.path.exists(uid2gamepath[uid])
]
],
)
self.maskshowfileexists.setStyleSheet(f"background-color:{c};") self.maskshowfileexists.setStyleSheet(f"background-color:{c};")
self.bottommask = QLabel(self) self.bottommask = QLabel(self)
self.bottommask.setStyleSheet("background-color: rgba(255,255,255, 0);") self.bottommask.setStyleSheet("background-color: rgba(255,255,255, 0);")

View File

@ -517,6 +517,8 @@
"onselectcolor1": "#007fff", "onselectcolor1": "#007fff",
"onfilenoexistscolor1": "#acacac", "onfilenoexistscolor1": "#acacac",
"transparent": 25, "transparent": 25,
"transparentselect": 25,
"transparentnotexits": 25,
"listitemheight": 40, "listitemheight": 40,
"listitemwidth": 300 "listitemwidth": 300
}, },