mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-13 07:33:53 +08:00
.
This commit is contained in:
parent
bbb2b23d4c
commit
3efca3b5ad
@ -354,57 +354,40 @@ class ItemWidget(QWidget):
|
||||
def resizeEvent(self, a0: QResizeEvent) -> None:
|
||||
self.bottommask.resize(a0.size())
|
||||
self.maskshowfileexists.resize(a0.size())
|
||||
self._imgsz()
|
||||
|
||||
def others(self):
|
||||
self._lb.setText(self.file if globalconfig["showgametitle"] else "")
|
||||
self._img.switch()
|
||||
self._imgsz()
|
||||
|
||||
def _imgsz(self):
|
||||
|
||||
textH = (
|
||||
globalconfig["dialog_savegame_layout"]["textH"]
|
||||
if globalconfig["showgametitle"]
|
||||
else 0
|
||||
)
|
||||
margin = globalconfig["dialog_savegame_layout"]["margin2"]
|
||||
self._img.setGeometry(
|
||||
margin,
|
||||
margin,
|
||||
self.width() - 2 * margin,
|
||||
self.height() - textH - 2 * margin,
|
||||
self.l.setContentsMargins(
|
||||
*([globalconfig["dialog_savegame_layout"]["margin2"]] * 4)
|
||||
)
|
||||
|
||||
if self._img._pixmap.isNull():
|
||||
self._lb.setGeometry(
|
||||
margin,
|
||||
max(
|
||||
margin,
|
||||
self.height() - self._lb.heightForWidth(self.width()) - margin,
|
||||
),
|
||||
self.width() - 2 * margin,
|
||||
min(self.height() - 2 * margin, self._lb.heightForWidth(self.width())),
|
||||
)
|
||||
pass
|
||||
else:
|
||||
|
||||
self._lb.setGeometry(
|
||||
margin,
|
||||
self.height() - textH - margin,
|
||||
self.width() - 2 * margin,
|
||||
textH,
|
||||
)
|
||||
self._lb.setFixedHeight(globalconfig["dialog_savegame_layout"]["textH"])
|
||||
self._img.switch()
|
||||
|
||||
def __init__(self, gameuid, pixmap, file) -> None:
|
||||
super().__init__()
|
||||
self.gameuid = gameuid
|
||||
self.file = file
|
||||
self.maskshowfileexists = QLabel(self)
|
||||
self.l = QVBoxLayout(self)
|
||||
self.l.setSpacing(0)
|
||||
self.l.setContentsMargins(
|
||||
*([globalconfig["dialog_savegame_layout"]["margin2"]] * 4)
|
||||
)
|
||||
self._img = IMGWidget(self, pixmap)
|
||||
self._lb = QLabel(self)
|
||||
self._lb.setText(file if globalconfig["showgametitle"] else "")
|
||||
if self._img._pixmap.isNull():
|
||||
self.l.setAlignment(Qt.AlignmentFlag.AlignBottom)
|
||||
else:
|
||||
self._lb.setFixedHeight(globalconfig["dialog_savegame_layout"]["textH"])
|
||||
self.l.addWidget(self._img)
|
||||
self._lb.setText(file)
|
||||
self._lb.setWordWrap(True)
|
||||
self._lb.setObjectName("savegame_textfont1")
|
||||
self._lb.setAlignment(Qt.AlignmentFlag.AlignHCenter)
|
||||
self.l.addWidget(self._lb)
|
||||
exists = os.path.exists(get_launchpath(gameuid))
|
||||
self.maskshowfileexists.setObjectName("savegame_exists" + str(exists))
|
||||
if not exists:
|
||||
|
@ -403,10 +403,6 @@ class dialog_syssetting(LDialog):
|
||||
isfontselector=True,
|
||||
),
|
||||
)
|
||||
formLayout.addRow(
|
||||
"显示标题",
|
||||
getsimpleswitch(globalconfig, "showgametitle"),
|
||||
)
|
||||
formLayout.addRow(
|
||||
"缩放",
|
||||
getsimplecombobox(
|
||||
|
@ -441,7 +441,6 @@
|
||||
"localeswitchmethod": 0,
|
||||
"hide_not_exists": false,
|
||||
"startgamenototop": true,
|
||||
"showgametitle": true,
|
||||
"extra_space": 0,
|
||||
"extra_space_trans": 0,
|
||||
"fonttype": "",
|
||||
@ -521,8 +520,8 @@
|
||||
"dialog_savegame_layout": {
|
||||
"itemw": 130,
|
||||
"itemh": 190,
|
||||
"margin": 8,
|
||||
"margin2": 8,
|
||||
"margin": 6,
|
||||
"margin2": 6,
|
||||
"textH": 0,
|
||||
"backcolor2": "#40ffffff",
|
||||
"onselectcolor2": "#40007fff",
|
||||
|
Loading…
x
Reference in New Issue
Block a user