Skip to content

Fix measurement UI overflow in TabbedView (issue #72) - #82

Open
rbrenesh wants to merge 1 commit into
ScopeFoundry:masterfrom
rbrenesh:fix/issue-72-mdi-tab-overflow
Open

Fix measurement UI overflow in TabbedView (issue #72)#82
rbrenesh wants to merge 1 commit into
ScopeFoundry:masterfrom
rbrenesh:fix/issue-72-mdi-tab-overflow

Conversation

@rbrenesh

@rbrenesh rbrenesh commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #72 — measurement UIs extending past the visible edge of the tabbed window.

Commit a8bd1f5 wrapped QMdiArea in a QScrollArea to allow free window resizing. In TabbedView mode this caused the active measurement tab to extend past the visible window edge — QMdiArea's content-driven minimumSizeHint() inflated the outer scroll area beyond the viewport.

This PR keeps the free-resize behavior that motivated a8bd1f5 while fixing the tab overflow:

  • base_microscope_app_mdi.ui: Restore QMdiArea as a direct child of col_splitter (remove the outer QScrollArea wrapper), and switch its size policy from MinimumExpanding to Expanding so the window can shrink below sizeHint().
  • base_microscope_app.py _setup_ui_base: Zero the minimum size on QMdiArea explicitly to override any internal floor from minimumSizeHint().
  • base_microscope_app.py add_mdi_subwin: Wrap each measurement widget in a QScrollArea(widgetResizable=True) so that when a UI's natural minimum width exceeds the available tab area, scrollbars appear inside the tab instead of forcing the window to grow. Zero the minimum size on both the inner scroll area and the QMdiSubWindow so nothing in the chain reintroduces a per-measurement minimum.

The result:

  • The app window can be freely resized to any size — preserving the fix from a8bd1f5 / issue UI: Measurements are not fitting anymore the window #72.
  • Active measurement tabs always fit within the visible window area, even when the underlying .ui has a large natural minimum size — scrollbars appear inside the tab as needed.

Test plan

  • Resize the window to a small size — confirm it shrinks freely (no large minimum enforced by any measurement UI).
  • Resize the window larger — confirm the active measurement tab grows to fill, and plot regions expand via stretch factors.
  • Verify the active tab never extends past the window edge in TabbedView mode, even for measurement UIs with large minimum widths (a per-tab scrollbar appears instead).
  • Switch to SubWindowView mode — confirm subwindows still move and resize normally.

…ScopeFoundry#72)

Commit a8bd1f5 wrapped QMdiArea in a QScrollArea to allow free window
resizing, but in TabbedView mode this caused the active measurement tab
to extend past the visible window edge — QMdiArea's content-driven
minimumSizeHint inflated the outer scroll area beyond the viewport.

Restore QMdiArea as a direct child of col_splitter so the splitter bounds
it to the available window space, and switch its policy from
MinimumExpanding to Expanding so the window can shrink below sizeHint.
Zero the minimum size on QMdiArea explicitly to override any internal
floor from minimumSizeHint().

Wrap each measurement widget in a QScrollArea inside add_mdi_subwin so
that when a UI's natural minimum width exceeds the available tab area,
scrollbars appear inside the tab instead of forcing the window to grow.
Zero the minimum size on both the scroll area and the QMdiSubWindow so
the chain doesn't reintroduce a per-measurement minimum.
@rbrenesh

rbrenesh commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Messed around with the base UI until I found something that worked. On my end, all modes worked as before except for tabbed mode, that keeps the horizontal scroll wheel if the measurement UI doesn't fit inside the original ScopeFoundry app, otherwise, the UI shrinks to fit within it (if specified by the user in their .ui file for their measurement)

@UBene UBene mentioned this pull request Jul 8, 2026
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.

UI: Measurements are not fitting anymore the window

1 participant