mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +08:00
issues/1005
This commit is contained in:
parent
dc1720dc73
commit
98d413011e
@ -51,7 +51,7 @@ from gui.usefulwidget import (
|
|||||||
getspinbox,
|
getspinbox,
|
||||||
listediterline,
|
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
|
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
|
return new_rect
|
||||||
|
|
||||||
@Singleton_close
|
@Singleton_close
|
||||||
class dialog_setting_game(QDialog):
|
class dialog_setting_game(LDialog):
|
||||||
|
|
||||||
def __init__(self, parent, gameuid, setindexhook=0) -> None:
|
def __init__(self, parent, gameuid, setindexhook=0) -> None:
|
||||||
super().__init__(parent, Qt.WindowType.WindowCloseButtonHint)
|
super().__init__(parent, Qt.WindowType.WindowCloseButtonHint)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import gobject
|
||||||
from myutils.config import _TR, _TRL
|
from myutils.config import _TR, _TRL
|
||||||
from qtsymbols import *
|
from qtsymbols import *
|
||||||
|
|
||||||
@ -161,10 +162,18 @@ class LFormLayout(QFormLayout):
|
|||||||
super().insertRow(row, *argc)
|
super().insertRow(row, *argc)
|
||||||
|
|
||||||
|
|
||||||
|
traceonepostion = {}
|
||||||
|
|
||||||
|
|
||||||
class LDialog(QDialog):
|
class LDialog(QDialog):
|
||||||
|
def moveEvent(self, e):
|
||||||
|
traceonepostion[self.parent()] = self.pos()
|
||||||
|
|
||||||
def __init__(self, *argc, **kwarg):
|
def __init__(self, *argc, **kwarg):
|
||||||
super().__init__(*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
|
self._title = None
|
||||||
|
|
||||||
def setWindowTitle(self, t):
|
def setWindowTitle(self, t):
|
||||||
|
@ -9,6 +9,7 @@ from myutils.config import (
|
|||||||
_TR,
|
_TR,
|
||||||
static_data,
|
static_data,
|
||||||
)
|
)
|
||||||
|
from gui.dialog_savedgame import dialog_setting_game
|
||||||
from myutils.utils import getlanguse, dynamiclink
|
from myutils.utils import getlanguse, dynamiclink
|
||||||
from myutils.subproc import endsubprocs
|
from myutils.subproc import endsubprocs
|
||||||
from myutils.ocrutil import ocr_run, imageCut
|
from myutils.ocrutil import ocr_run, imageCut
|
||||||
@ -641,7 +642,11 @@ class TranslatorWindow(resizableframeless):
|
|||||||
),
|
),
|
||||||
(
|
(
|
||||||
"open_game_setting",
|
"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),
|
("ocr_once", self.ocr_once_signal.emit),
|
||||||
("minmize", self.hide_),
|
("minmize", self.hide_),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user