From 46857e622190cc188fbf5da9bb5e955e2799f3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Wed, 1 May 2024 01:03:42 +0800 Subject: [PATCH] setting --- .../LunaTranslator/gui/dialog_savedgame.py | 18 ++++++++---------- LunaTranslator/files/defaultconfig/config.json | 5 +++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index 04dc2885..9c1e8cd3 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -151,16 +151,13 @@ class ItemWidget(QWidget): layout.addWidget(self._lb) self.setLayout(layout) self.exe = exe - if os.path.exists(exe): - self.maskshowfileexists.setStyleSheet( - "QLabel { background-color: rgba(255,255,255, 0); }" - ) - else: - self.maskshowfileexists.setStyleSheet( - "QLabel { background-color: " - + globalconfig["dialog_savegame_layout"]["onfilenoexistscolor"] - + "; }" - ) + self.maskshowfileexists.setStyleSheet( + "QLabel { background-color: " + + globalconfig["dialog_savegame_layout"][ + ("onfilenoexistscolor", "backcolor")[os.path.exists(exe)] + ] + + "; }" + ) class IMGWidget(QLabel): @@ -1244,6 +1241,7 @@ class dialog_syssetting(QDialog): getspinbox(0, 1000, globalconfig["dialog_savegame_layout"], key), ) for key, name in [ + ("backcolor", "颜色"), ("onselectcolor", "选中时颜色"), ("onfilenoexistscolor", "游戏不存在时颜色"), ]: diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index 64d52271..8cf6454c 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -193,8 +193,9 @@ "itemh": 350, "margin":10, "textH":50, - "onselectcolor": "rgba(0,100,200, 0.3)", - "onfilenoexistscolor": "rgba(25,25,25, 0.3)" + "backcolor": "#c38282", + "onselectcolor": "#007fff", + "onfilenoexistscolor": "#acacac" }, "profiles_index": 0, "ocrautobindwindow": true,