Skip to content

Commit

Permalink
adjust font size for different res
Browse files Browse the repository at this point in the history
  • Loading branch information
aeon0 committed Nov 3, 2023
1 parent 82cb85e commit 806e583
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,9 @@ def __init__(self):
self.screen_width = self.root.winfo_screenwidth()
self.screen_height = self.root.winfo_screenheight()
self.initial_height = int(self.root.winfo_screenheight() * 0.03)
if Config().ui_pos["window_dimensions"] == (2560, 1440):
self.initial_width = int(self.screen_width * 0.072)
self.maximized_height = int(self.initial_height * 3.4)
self.maximized_width = int(self.initial_width * 6)
else:
self.initial_width = int(self.screen_width * 0.072)
self.maximized_height = int(self.initial_height * 3.85)
self.maximized_width = int(self.initial_width * 4.8)
self.initial_width = int(self.screen_width * 0.072)
self.maximized_height = int(self.initial_height * 3.4)
self.maximized_width = int(self.initial_width * 5)

self.canvas = tk.Canvas(self.root, bg="black", height=self.initial_height, width=self.initial_width, highlightthickness=0)
self.root.geometry(
Expand Down Expand Up @@ -82,6 +77,11 @@ def __init__(self):
)
self.canvas.create_window(int(self.initial_width * 0.8), self.initial_height // 2, window=self.start_scripts_button)

font_size = 8
if Config().ui_pos["window_dimensions"] == (2560, 1440):
font_size = 9
elif Config().ui_pos["window_dimensions"] == (3840, 2160):
font_size = 10
self.terminal_listbox = tk.Listbox(
self.canvas,
bg="black",
Expand All @@ -91,7 +91,7 @@ def __init__(self):
selectbackground="#222222",
activestyle=tk.NONE,
borderwidth=0,
font=("Courier New", 9),
font=("Courier New", font_size),
)
self.terminal_listbox.place(
relx=0,
Expand Down

0 comments on commit 806e583

Please sign in to comment.