feat: add scrollbar via CTkScrollableFrame for window resize

- Replace main_frame CTkFrame → CTkScrollableFrame for vertical scrollbar
- Remove main_frame.grid_rowconfigure weight — content natural height
- Remove right_frame.grid_rowconfigure weight — prevents squashing
- Left column (workflow + log) retains weight=1 for dominant width
- Right column (config/serial/utility/status) keeps natural narrow width
This commit is contained in:
2026-06-11 14:31:17 +08:00
parent 84142bb229
commit 9b07a4d5ca
+2 -4
View File
@@ -265,10 +265,9 @@ class MainWindow(ctk.CTk):
def _build_ui(self) -> None: def _build_ui(self) -> None:
"""Build the complete UI layout.""" """Build the complete UI layout."""
# Main container with padding # Scrollable main container — scrollbar appears when content overflows
main_frame = ctk.CTkFrame(self) main_frame = ctk.CTkScrollableFrame(self)
main_frame.pack(fill="both", expand=True, padx=PADDING_LARGE, pady=PADDING_LARGE) main_frame.pack(fill="both", expand=True, padx=PADDING_LARGE, pady=PADDING_LARGE)
main_frame.grid_rowconfigure(1, weight=1)
main_frame.grid_columnconfigure(0, weight=1) main_frame.grid_columnconfigure(0, weight=1)
# ── Header ── # ── Header ──
@@ -286,7 +285,6 @@ class MainWindow(ctk.CTk):
# ── Right Panel: Configuration ── # ── Right Panel: Configuration ──
right_frame = ctk.CTkFrame(main_frame) right_frame = ctk.CTkFrame(main_frame)
right_frame.grid(row=1, column=1, sticky="nsew", padx=(PADDING, 0)) right_frame.grid(row=1, column=1, sticky="nsew", padx=(PADDING, 0))
right_frame.grid_rowconfigure(3, weight=1)
right_frame.grid_columnconfigure(0, weight=1) right_frame.grid_columnconfigure(0, weight=1)
self._build_config_panel(right_frame) self._build_config_panel(right_frame)