Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
HIllya51 committed Dec 28, 2024
1 parent cfe332c commit 3d422a4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion py/LunaTranslator/gui/dialog_savedgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def __init__(self, gameuid) -> None:
self.l.setSpacing(0)
self.l.setContentsMargins(
*([globalconfig["dialog_savegame_layout"]["margin2"]] * 4)
)
)
for image in savehook_new_data[gameuid]["imagepath_all"]:
fr = extradatas["imagefrom"].get(image)
if fr:
Expand Down Expand Up @@ -642,6 +642,12 @@ def loadcombo(self, init):
),
)

def callexists(self, _):
if _:
self.tagswidget.addTag(_TR("存在"), tagitem.TYPE_EXISTS)
else:
self.tagswidget.removeTag((_TR("存在"), tagitem.TYPE_EXISTS, None))

def callchange(self):
self.flow.setsize(
QSize(
Expand Down
2 changes: 1 addition & 1 deletion py/LunaTranslator/gui/dialog_savedgame_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def __init__(self, parent, type_=1) -> None:

formLayout.addRow(
"隐藏不存在的游戏",
getsimpleswitch(globalconfig, "hide_not_exists"),
getsimpleswitch(globalconfig, "hide_not_exists", callback=self.parent().callexists),
)

formLayout.addRow(
Expand Down
3 changes: 3 additions & 0 deletions py/LunaTranslator/gui/dialog_savedgame_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,9 @@ def addtolist(self):
def directshow(self):
self.stack.directshow()

def callexists(self, _):
pass

def callchange(self):
self.stack.setheight(
globalconfig["dialog_savegame_layout"]["listitemheight"] + 1
Expand Down

0 comments on commit 3d422a4

Please sign in to comment.