Skip to content

Commit

Permalink
Update DPI settings
Browse files Browse the repository at this point in the history
  • Loading branch information
HACKERALERT authored Mar 13, 2021
1 parent bf29277 commit 37d6bfd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/Picocrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
import tkinter.scrolledtext
import webbrowser

# Set high DPI on Windows
# Tk/Tcl is a little barbaric, disable
# high DPI so it doesn't look really ugly
try:
from ctypes import windll
windll.shcore.SetProcessDpiAwareness(1)
windll.shcore.SetProcessDpiAwareness(0)
except:
pass

Expand All @@ -60,18 +61,11 @@

# Create root Tk
tk = tkinter.Tk()
#tk.tk.call('tk', 'scaling', 2.0)
tk.geometry("480x420")
tk.title("Picocrypt")
tk.configure(background="#f5f6f7")
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:
favicon = tkinter.PhotoImage(file="./key.png")
Expand Down

0 comments on commit 37d6bfd

Please sign in to comment.