From 806e583b93e43b0edb8a5621c1c2a7c3ed05314d Mon Sep 17 00:00:00 2001 From: aeon0 Date: Fri, 3 Nov 2023 06:21:16 +0100 Subject: [PATCH] adjust font size for different res --- src/overlay.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/overlay.py b/src/overlay.py index 2df20f63..173b6c0b 100644 --- a/src/overlay.py +++ b/src/overlay.py @@ -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( @@ -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", @@ -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,