diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py index 3f3a8501..006df799 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py @@ -51,7 +51,7 @@ from gui.usefulwidget import ( getspinbox, listediterline, ) -from gui.dynalang import LFormLayout, LPushButton, LStandardItemModel, LAction, LLabel +from gui.dynalang import LFormLayout, LPushButton, LStandardItemModel, LAction, LLabel, LDialog from gui.dialog_savedgame_common import tagitem, TagWidget @@ -1139,7 +1139,7 @@ def calculate_centered_rect(original_rect: QRect, size: QSize) -> QRect: return new_rect @Singleton_close -class dialog_setting_game(QDialog): +class dialog_setting_game(LDialog): def __init__(self, parent, gameuid, setindexhook=0) -> None: super().__init__(parent, Qt.WindowType.WindowCloseButtonHint) diff --git a/LunaTranslator/LunaTranslator/gui/dynalang.py b/LunaTranslator/LunaTranslator/gui/dynalang.py index 052bde8c..e331ba8c 100644 --- a/LunaTranslator/LunaTranslator/gui/dynalang.py +++ b/LunaTranslator/LunaTranslator/gui/dynalang.py @@ -1,3 +1,4 @@ +import gobject from myutils.config import _TR, _TRL from qtsymbols import * @@ -161,10 +162,18 @@ class LFormLayout(QFormLayout): super().insertRow(row, *argc) +traceonepostion = {} + + class LDialog(QDialog): + def moveEvent(self, e): + traceonepostion[self.parent()] = self.pos() def __init__(self, *argc, **kwarg): super().__init__(*argc, **kwarg) + if self.parent() == gobject.baseobject.commonstylebase: + if traceonepostion.get(self.parent(), None): + self.move(traceonepostion.get(self.parent(), None)) self._title = None def setWindowTitle(self, t): diff --git a/LunaTranslator/LunaTranslator/gui/translatorUI.py b/LunaTranslator/LunaTranslator/gui/translatorUI.py index 8669a9b4..215b046f 100644 --- a/LunaTranslator/LunaTranslator/gui/translatorUI.py +++ b/LunaTranslator/LunaTranslator/gui/translatorUI.py @@ -9,6 +9,7 @@ from myutils.config import ( _TR, static_data, ) +from gui.dialog_savedgame import dialog_setting_game from myutils.utils import getlanguse, dynamiclink from myutils.subproc import endsubprocs from myutils.ocrutil import ocr_run, imageCut @@ -641,7 +642,11 @@ class TranslatorWindow(resizableframeless): ), ( "open_game_setting", - lambda: gobject.baseobject.hookselectdialog.opengamesetting(), + lambda: dialog_setting_game( + gobject.baseobject.commonstylebase, + gobject.baseobject.textsource.gameuid, + 1, + ), ), ("ocr_once", self.ocr_once_signal.emit), ("minmize", self.hide_),