From 2a9b2488ff65e3d4a2c5e9de898e597c08f0a2ae 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: Mon, 3 Jun 2024 14:45:25 +0800 Subject: [PATCH] ... --- LunaTranslator/LunaTranslator/gui/dialog_savedgame.py | 8 +++----- LunaTranslator/LunaTranslator/gui/usefulwidget.py | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index c412f3f9..3f216cf7 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -594,7 +594,6 @@ class dialog_setting_game_internal(QWidget): def __init__(self, parent, exepath) -> None: super().__init__(parent) vbox = QVBoxLayout(self) - vbox.setContentsMargins(0, 0, 0, 0) self.setLayout(vbox) formLayout = QFormLayout() self.exepath = exepath @@ -1235,12 +1234,12 @@ class dialog_setting_game(QDialog): l = QHBoxLayout(self) self.setLayout(l) l.addWidget(_) - + l.setContentsMargins(0,0,0,0) self.show() try: self.setGeometry( calculate_centered_rect( - _global_dialog_savedgame_new.geometry(), self.size() + _global_dialog_savedgame_new.parent().parent().geometry(), self.size() ) ) except: @@ -2249,8 +2248,7 @@ class dialog_savedgame_v3(QWidget): tabadd_lazy( self.righttop, savehook_new_data[k]["title"], - lambda v: v.addWidget(dialog_setting_game_internal(self, k)), - margin0=False, + lambda v: v.addWidget(dialog_setting_game_internal(self, k)) ) except: diff --git a/LunaTranslator/LunaTranslator/gui/usefulwidget.py b/LunaTranslator/LunaTranslator/gui/usefulwidget.py index dbacfa12..1c089335 100644 --- a/LunaTranslator/LunaTranslator/gui/usefulwidget.py +++ b/LunaTranslator/LunaTranslator/gui/usefulwidget.py @@ -853,12 +853,11 @@ class threebuttons(QWidget): layout.addWidget(button3) -def tabadd_lazy(tab, title, getrealwidgetfunction, margin0=True): +def tabadd_lazy(tab, title, getrealwidgetfunction): q = QWidget() v = QVBoxLayout() q.setLayout(v) - if margin0: - v.setContentsMargins(0, 0, 0, 0) + v.setContentsMargins(0, 0, 0, 0) q.lazyfunction = functools.partial(getrealwidgetfunction, v) tab.addTab(q, title)