Conversation
Introduce themed_grid and configure_grid utilities (and spacing resolution helpers) to centralize spacing, padding and grid configuration using theme tokens. Replace many direct .grid/.grid_rowconfigure calls across the main window, tabs and panels with themed_grid/configure_grid to enforce consistent layout and spacing. Extend theme presets with layout and padding tokens (layout_window/panel/section/control gaps, canvas/sidebar sizes, panel/card paddings) and adjust notebook tab styling/padding. Make camera/display sizing and resize handling more robust: add _get_canvas_widget_size helper, allow update_canvas_size to accept optional width/height, reduce refresh debounce and tighten size-change thresholds, bind resize handler to the canvas and track binding IDs, and add extra defensive checks to avoid tiny/invalid sizes. Minor controller change: call update_idletasks during main resize to ensure measurements are stable.
Replace direct grid calls with themed_grid and configure_grid across multiple UI modules to centralize layout behavior and support theme spacing tokens. Add get_theme_spacing usage and a helper _resolve_pad_value to allow padding to be specified as theme tokens or raw numbers, and update LabelInput.pad_input to resolve tokens. Fix PhotoImage master usage and adjust various grid/padding calls to use theme spacing identifiers. Update and extend tests: adapt LabelInput tests and add test_main_ui_layout to assert weighted layout configuration.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1202 +/- ##
===========================================
+ Coverage 63.47% 63.57% +0.10%
===========================================
Files 189 189
Lines 25864 25928 +64
===========================================
+ Hits 16416 16485 +69
+ Misses 9448 9443 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR standardizes GUI layout spacing by introducing theme-based spacing tokens and helper utilities, then refactoring multiple Tk/ttk grid layouts to use those tokens for more consistent padding and resizing behavior across the main window.
Changes:
- Add new layout/padding spacing tokens to the theme and refine notebook tab styling (selected vs unselected visuals).
- Introduce
themed_grid()andconfigure_grid()helpers and refactor several view layouts to use them instead of hard-coded padding/grid configuration. - Update camera canvas resize handling and add/adjust tests to validate grid weights and spacing-token resolution.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/view/main_window_content/test_main_ui_layout.py | New tests asserting key grid weight/sticky expectations for core UI containers. |
| test/view/custom_widgets/test_LabelInputWidgetFactory.py | Updates existing LabelInput tests and adds coverage for spacing-token padding resolution. |
| src/navigate/view/theme.py | Adds layout spacing/padding tokens; adjusts notebook tab visuals and selected-tab padding/expand behavior. |
| src/navigate/view/custom_widgets/common.py | Adds themed_grid() and configure_grid() utilities + spacing token resolution. |
| src/navigate/view/custom_widgets/LabelInputWidgetFactory.py | Uses new grid helpers; updates pad_input() to resolve theme spacing tokens. |
| src/navigate/view/main_application_window.py | Refactors main window frame gridding to use theme-based gaps and declarative grid config. |
| src/navigate/view/main_window_content/acquire_notebook.py | Refactors AcquireBar grid config to use theme spacing and weighted progress layout. |
| src/navigate/view/main_window_content/settings_notebook.py | Ensures settings notebook expands via themed grid + declarative weight configuration. |
| src/navigate/view/main_window_content/display_notebook.py | Refactors camera/mip/waveform tab layouts to use theme padding, min sizes, and declarative grid config. |
| src/navigate/view/main_window_content/camera_tab.py | Refactors camera settings tab spacing to theme tokens and declarative grid configuration. |
| src/navigate/view/main_window_content/channels_tab.py | Refactors channels tab layout spacing and grid weights; adopts theme spacing for padding defaults. |
| src/navigate/view/main_window_content/multiposition_tab.py | Refactors multiposition tab layout to theme spacing and simpler weighted grid. |
| src/navigate/view/main_window_content/stage_tab.py | Refactors stage tab gridding to theme spacing and declarative grid configuration; sets PhotoImage master. |
| src/navigate/controller/sub_controllers/waveform_tab.py | Uses themed grid helper when placing the matplotlib canvas widget. |
| src/navigate/controller/sub_controllers/camera_view.py | Reworks canvas sizing/resizing logic to track real widget size more reliably and bind resize to the canvas. |
| src/navigate/controller/controller.py | Simplifies resize refresh path (removes explicit right_frame size config, relies on layout updates). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Replace hard-coded pixel paddings with theme helpers (get_theme_space_px / get_theme_padding_px) across configurator and main UI widgets, CollapsibleFrame, hover, and stage tab to ensure consistent spacing. Fix canvas image logic in camera_view: normalize _img_item creation scope, clear _img_item and tk_image in _clear_mip, and use _get_canvas_widget_size() when composing multi-perspective MIP down-sampling. Minor cleanups: use isinstance checks where appropriate. Add/adjust tests to cover canvas sizing, clearing/recreating image items, and themed spacing in UI layouts.
No description provided.