Z230
This commit is contained in:
@@ -90,7 +90,20 @@ def main():
|
||||
|
||||
show(0)
|
||||
root.update_idletasks()
|
||||
root.geometry("+0+0")
|
||||
sw = root.winfo_screenwidth()
|
||||
w = root.winfo_width()
|
||||
h = root.winfo_height()
|
||||
x = (sw - w) // 2
|
||||
root.geometry(f"+{x}+0")
|
||||
|
||||
# Zapiš geometrii do souboru pokud byl předán argument --write-geometry=<cesta>
|
||||
import json as _json
|
||||
for arg in sys.argv:
|
||||
if arg.startswith("--write-geometry="):
|
||||
geom_path = Path(arg.split("=", 1)[1])
|
||||
geom_path.write_text(_json.dumps({"x": x, "y": 0, "w": w, "h": h}), encoding="utf-8")
|
||||
break
|
||||
|
||||
root.mainloop()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user