[TRPD-181][fix] GUI: on window resize, resize all tabs - #3544
Conversation
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.
There was a problem hiding this comment.
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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:
the drawing either doesn't happen or does odd things.
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.