issues/1005

This commit is contained in:
恍兮惚兮 2024-08-17 09:25:18 +08:00
parent dc1720dc73
commit 98d413011e
3 changed files with 17 additions and 3 deletions

View File

@ -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)

View File

@ -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):

View File

@ -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_),