mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-28 08:04:13 +08:00
autohide
This commit is contained in:
parent
0b47580088
commit
7abc23f171
@ -430,12 +430,21 @@ class TranslatorWindow(resizableframeless):
|
||||
@threader
|
||||
def autohidedelaythread(self):
|
||||
while True:
|
||||
# 当鼠标悬停,或前景窗口为当前进程的其他窗口时,禁止自动隐藏
|
||||
if self.geometry().contains(QCursor.pos()) or (
|
||||
windows.GetForegroundWindow() != self.winid
|
||||
and windows.GetWindowThreadProcessId(windows.GetForegroundWindow())
|
||||
== os.getpid()
|
||||
):
|
||||
self.lastrefreshtime = time.time()
|
||||
continue
|
||||
if globalconfig["autodisappear"] and self.autohidestart:
|
||||
tnow = time.time()
|
||||
if tnow - self.lastrefreshtime >= globalconfig["disappear_delay"]:
|
||||
if (
|
||||
time.time() - self.lastrefreshtime
|
||||
>= globalconfig["disappear_delay"]
|
||||
):
|
||||
self.hidesignal.emit()
|
||||
self.autohidestart = False
|
||||
self.lastrefreshtime = tnow
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
|
@ -29,7 +29,7 @@ include(generate_product_version)
|
||||
|
||||
set(VERSION_MAJOR 5)
|
||||
set(VERSION_MINOR 53)
|
||||
set(VERSION_PATCH 12)
|
||||
set(VERSION_PATCH 13)
|
||||
|
||||
add_library(pch pch.cpp)
|
||||
target_precompile_headers(pch PUBLIC pch.h)
|
||||
|
Loading…
x
Reference in New Issue
Block a user