Skip to content

Commit

Permalink
Fix 1440p templates (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeon0 authored Nov 3, 2023
1 parent 30df8c7 commit 2ac20c8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
Binary file modified assets/templates_2560x1440/char_inventory_active.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates_2560x1440/char_inventory_active_hover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/templates_2560x1440/stash_menu_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def update_window_pos(self, offset_x: int, offset_y: int, width: int, height: in
and self.window_roi["height"] == height
):
return
Logger.info(f"Found Window. offsets: left {offset_x}px, top {offset_y}px, width {width}px, height {height}px")
self.res_key = f"{width}x{height}"
Logger.info(f"Found Window Res: {self.res_key}")
if self.res_key not in ["1920x1080", "2560x1440"]:
Logger.error(f"The resoltuion: {self.res_key} is not supported.")
os._exit(0)
Expand Down
11 changes: 8 additions & 3 deletions src/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def __init__(self):
self.screen_height = self.root.winfo_screenheight()
self.initial_height = int(self.root.winfo_screenheight() * 0.03)
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 * 6)
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 @@ -77,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 @@ -86,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 2ac20c8

Please sign in to comment.