Skip to content

Uniform padding#1202

Merged
AdvancedImagingUTSW merged 6 commits intodevelopfrom
uniform-padding
Mar 14, 2026
Merged

Uniform padding#1202
AdvancedImagingUTSW merged 6 commits intodevelopfrom
uniform-padding

Conversation

@AdvancedImagingUTSW
Copy link
Collaborator

No description provided.

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
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 91.78886% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.57%. Comparing base (7f79199) to head (a414ad4).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...c/navigate/view/configurator_application_window.py 33.33% 14 Missing ⚠️
.../navigate/view/main_window_content/channels_tab.py 87.50% 5 Missing ⚠️
src/navigate/view/main_window_content/stage_tab.py 87.87% 4 Missing ⚠️
src/navigate/view/custom_widgets/common.py 94.54% 3 Missing ⚠️
...ate/view/custom_widgets/LabelInputWidgetFactory.py 93.33% 1 Missing ⚠️
src/navigate/view/theme.py 66.66% 1 Missing ⚠️
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     
Flag Coverage Δ
unittests 63.57% <91.78%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AdvancedImagingUTSW AdvancedImagingUTSW marked this pull request as ready for review March 12, 2026 23:50
Copilot AI review requested due to automatic review settings March 12, 2026 23:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() and configure_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.
@AdvancedImagingUTSW AdvancedImagingUTSW merged commit ceacaf5 into develop Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants