From 62b736c205ed75058e58ef0f7f8a312004dcce7f Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Sun, 6 Sep 2026 09:28:00 +0200 Subject: [PATCH] Add responsive production UI entry point --- setup_tool_responsive.py | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 setup_tool_responsive.py diff --git a/setup_tool_responsive.py b/setup_tool_responsive.py new file mode 100644 index 0000000..68fcfa8 --- /dev/null +++ b/setup_tool_responsive.py @@ -0,0 +1,51 @@ +import tkinter as tk +from tkinter import ttk + +import setup_tool_dynamic + + +class ResponsiveModernWowSetupTool(setup_tool_dynamic.ModernWowSetupTool): + """Production entry point with DPI/display-scaling-safe window behavior.""" + + def __init__(self, root): + super().__init__(root) + + # Preserve all existing installer behavior and only change how the + # top-level Tk window allocates and exposes its controls. + root.resizable(True, True) + + # Reserve the bottom action button before the expandable notebook so + # Windows DPI/text scaling cannot push Apply outside the visible area. + notebook = next( + (child for child in root.winfo_children() if isinstance(child, ttk.Notebook)), + None, + ) + apply_button = getattr(self, "apply_button", None) + if notebook is not None and apply_button is not None: + notebook.pack_forget() + apply_button.pack_forget() + apply_button.pack(side="bottom", pady=10, fill="x", padx=20) + notebook.pack(fill="both", expand=True, padx=10, pady=(5, 10)) + + root.update_idletasks() + + # Prefer the widgets' requested size when the monitor has room, while + # keeping a margin so the window remains reachable on smaller screens. + screen_width = max(1, root.winfo_screenwidth()) + screen_height = max(1, root.winfo_screenheight()) + max_width = max(640, screen_width - 80) + max_height = max(520, screen_height - 80) + + requested_width = max(680, root.winfo_reqwidth()) + requested_height = max(660, root.winfo_reqheight()) + width = min(requested_width, max_width) + height = min(requested_height, max_height) + + root.geometry(f"{width}x{height}") + root.minsize(min(640, max_width), min(520, max_height)) + + +if __name__ == "__main__": + root = tk.Tk() + app = ResponsiveModernWowSetupTool(root) + root.mainloop()