notebookvb

This commit is contained in:
Vladimir Buzalka
2026-05-04 21:26:44 +02:00
parent 417cf86b2d
commit ffb3db1e07
12 changed files with 1143 additions and 16 deletions
+14 -1
View File
@@ -81,19 +81,32 @@ def main():
root.update_idletasks()
sw = root.winfo_screenwidth()
w = root.winfo_width()
h = root.winfo_height()
x = (sw - w) // 2
# Skutečná použitelná výška (bez taskbaru)
import ctypes, ctypes.wintypes
rect = ctypes.wintypes.RECT()
ctypes.windll.user32.SystemParametersInfoW(48, 0, ctypes.byref(rect), 0)
work_bottom = rect.bottom # spodní hrana work area
# Pozice pod preview oknem pokud byl předán argument --below-y=N
below_y = None
for arg in sys.argv:
if arg.startswith("--below-y="):
below_y = int(arg.split("=", 1)[1])
break
y = below_y if below_y is not None else (root.winfo_screenheight() - root.winfo_height() - 60)
if below_y is not None and below_y + h + 10 <= work_bottom:
y = below_y # vejde se pod preview
else:
y = max(0, work_bottom - h - 10) # přilepit těsně nad taskbar
root.geometry(f"+{x}+{y}")
root.lift()
root.focus_force()
root.after(100, lambda: root.focus_force())
root.after(200, lambda: root.attributes("-topmost", True))
root.mainloop()
print(json.dumps({"value": result["value"]}, ensure_ascii=False))