Skip to content

[TRPD-181][fix] GUI: on window resize, resize all tabs - #3544

Open
pieleric wants to merge 1 commit into
delmic:masterfrom
pieleric:fix-gui-on-window-resize-resize-all-tabs
Open

[TRPD-181][fix] GUI: on window resize, resize all tabs#3544
pieleric wants to merge 1 commit into
delmic:masterfrom
pieleric:fix-gui-on-window-resize-resize-all-tabs

Conversation

@pieleric

@pieleric pieleric commented Aug 11, 2026

Copy link
Copy Markdown
Member

With wxPython, only the currently shown tab is resized to the current window size.
So a tab only get the size of the window at the moment it is selected
and shown.

That causes two issues:

  • at init, until the tab is shown, its size is very tiny, and most of
    the drawing either doesn't happen or does odd things.
  • when the tab is shown, it is resized, which causes a ~0.1s flash that is
    not pretty for the user

=> Resize the all the tabs when the main window is resized. For
efficiency, we do this at most every 0.5s.

In particular, this fixes an issue where on the SPARC the first acquisition
would not be displayed zoomed in. That's because the content fitting
happened with the tab still sized at 0px width.

With wxPython, only the currently shown tab is resized to the current window size.
So a tab only get the size of the window at the moment it is selected
and shown.

That causes two issues:
* at init, until the tab is shown, its size is very tiny, and most of
  the drawing either doesn't happen or does odd things.
* when the tab is shown, it is resized, and this takes a ~0.1s that is
  not pretty for the user

=> Resize the all the tabs when the main window is resized. For
efficiency, we do this at most every 0.5s.

In particular, this fixes an issue where on the SPARC the first acquisition
would not be displayed zoomed in. That's because the content fitting
happened with the tab still sized at 0px width.
Copilot AI lite review requested due to automatic review settings August 11, 2026 03:26
@pieleric pieleric changed the title [fix] GUI: on window resize, resize all tabs [TRPD-181][fix] GUI: on window resize, resize all tabs Aug 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the GUI tab controller so that when the main window is resized, all tab panels are resized (not only the currently visible one), reducing first-show layout glitches and improving perceived responsiveness when switching tabs.

Changes:

  • Bind a main-frame resize handler to propagate sizing to all tab panels.
  • Add rate-limited logic (0.5s) to update hidden tabs’ panel sizes to match the shown tab.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/odemis/gui/cont/tabs/tab_bar_controller.py
@pieleric
pieleric requested a review from tmoerkerken August 11, 2026 03:30
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ea8860d-965b-438f-9056-e53e271efe4a

📥 Commits

Reviewing files that changed from the base of the PR and between 7999c52 and d7c6ccc.

📒 Files selected for processing (1)
  • src/odemis/gui/cont/tabs/tab_bar_controller.py

📝 Walkthrough

Walkthrough

TabBarController now listens for main-frame resize events. It skips initially tiny dimensions and propagates valid events. A throttled refit resizes non-current tab panels to the current tab’s valid size and lays out panels whose size changed.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes resizing all GUI tabs when the window is resized.
Description check ✅ Passed The description explains the tab resizing behavior, throttling, user impact, and SPARC issue addressed by the changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants