mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-01 10:04:12 +08:00
perf
This commit is contained in:
parent
52396b957b
commit
b88a4049e4
@ -589,6 +589,7 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
self.translate_text.contentsChanged.connect(self.textAreaChanged)
|
self.translate_text.contentsChanged.connect(self.textAreaChanged)
|
||||||
t = QTimer(self)
|
t = QTimer(self)
|
||||||
t.setInterval(100)
|
t.setInterval(100)
|
||||||
|
self._isentered = False
|
||||||
t.timeout.connect(self.__betterenterevent)
|
t.timeout.connect(self.__betterenterevent)
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
@ -868,7 +869,8 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
self.set_color_transparency()
|
self.set_color_transparency()
|
||||||
|
|
||||||
def __betterenterevent(self):
|
def __betterenterevent(self):
|
||||||
if self.geometry().contains(QCursor.pos()):
|
if (not self._isentered) and self.geometry().contains(QCursor.pos()):
|
||||||
|
self._isentered = True
|
||||||
self.enterfunction()
|
self.enterfunction()
|
||||||
|
|
||||||
@threader
|
@threader
|
||||||
@ -877,6 +879,7 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
self.enter_sig = enter_sig
|
self.enter_sig = enter_sig
|
||||||
while self.geometry().contains(QCursor.pos()):
|
while self.geometry().contains(QCursor.pos()):
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
self._isentered = False
|
||||||
time.sleep(delay)
|
time.sleep(delay)
|
||||||
if self.enter_sig != enter_sig:
|
if self.enter_sig != enter_sig:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user