Fixed high DPI issue

This commit is contained in:
Evan Su 2021-03-13 12:27:03 -05:00 committed by GitHub
parent e3216da69b
commit bf29277b92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -66,6 +66,12 @@ tk.title("Picocrypt")
tk.configure(background="#f5f6f7") tk.configure(background="#f5f6f7")
tk.resizable(0,0) tk.resizable(0,0)
try:
dpi = windll.user32.GetDpiForWindow(tk.winfo_id())
tk.tk.call("tk","scaling",dpi/72.0)
except:
pass
# Try setting image if included with Picocrypt # Try setting image if included with Picocrypt
try: try:
favicon = tkinter.PhotoImage(file="./key.png") favicon = tkinter.PhotoImage(file="./key.png")