This commit is contained in:
恍兮惚兮 2024-11-03 23:33:55 +08:00
parent 0b47580088
commit 7abc23f171
2 changed files with 14 additions and 5 deletions

View File

@ -405,7 +405,7 @@ class TranslatorWindow(resizableframeless):
iter_res_status = 0
if iter_res_status:
self.translate_text.iter_append(
iter_context_class, origin, atcenter,name, text, color
iter_context_class, origin, atcenter, name, text, color
)
else:
self.translate_text.append(
@ -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)

View File

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