mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
delay
This commit is contained in:
parent
d8a4fb6b77
commit
8b281849fb
@ -43,6 +43,7 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
hidesignal = pyqtSignal()
|
hidesignal = pyqtSignal()
|
||||||
muteprocessignal = pyqtSignal()
|
muteprocessignal = pyqtSignal()
|
||||||
ocr_once_signal = pyqtSignal()
|
ocr_once_signal = pyqtSignal()
|
||||||
|
resizesignal = pyqtSignal(QSize)
|
||||||
|
|
||||||
def hookfollowsignalsolve(self, code, other):
|
def hookfollowsignalsolve(self, code, other):
|
||||||
if self._move_drag:
|
if self._move_drag:
|
||||||
@ -558,6 +559,7 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
|
|
||||||
self.muteprocessignal.connect(self.muteprocessfuntion)
|
self.muteprocessignal.connect(self.muteprocessfuntion)
|
||||||
self.toolbarhidedelaysignal.connect(self.toolbarhidedelay)
|
self.toolbarhidedelaysignal.connect(self.toolbarhidedelay)
|
||||||
|
self.resizesignal.connect(self.resize)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
@ -845,7 +847,20 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
newHeight = (
|
newHeight = (
|
||||||
limit + self.translate_text._padding + int(globalconfig["buttonsize"] * 1.5)
|
limit + self.translate_text._padding + int(globalconfig["buttonsize"] * 1.5)
|
||||||
)
|
)
|
||||||
self.resize(self.width(), newHeight)
|
size = QSize(self.width(), newHeight)
|
||||||
|
self.autoresizesig = time.time()
|
||||||
|
if newHeight > self.height():
|
||||||
|
self.resize(size)
|
||||||
|
else:
|
||||||
|
self.delaymaybeshrink(size, self.autoresizesig)
|
||||||
|
|
||||||
|
@threader
|
||||||
|
def delaymaybeshrink(self, size: QSize, sig):
|
||||||
|
|
||||||
|
time.sleep(0.1)
|
||||||
|
if sig != self.autoresizesig:
|
||||||
|
return
|
||||||
|
self.resizesignal.emit(size)
|
||||||
|
|
||||||
def clickRange(self, auto):
|
def clickRange(self, auto):
|
||||||
if globalconfig["sourcestatus2"]["ocr"]["use"] == False:
|
if globalconfig["sourcestatus2"]["ocr"]["use"] == False:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user