-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wxGUI/nviz: fix showing scrollbars on the Data, Appearance, Analysis page (tab) #3250
Conversation
Thanks for the analysis, but looking at the changes I am worried this is getting out of hand. The code is already complicated and this relies on undocumented behavior. How about just dropping this problematic widget altogether, and use standard tabs (at the botom) instead of the FoldPanelBar? The motivation was to avoid second row of tabs at the bottom, but at this point, I think maintainable code with standard widgets is more important for me. Any thoughts? |
I'd also would like to thank you @tmszi for the efforts you put into this (including setting up a VM!) I also felt/feel a bit unsure on the amount of code needed (?) for this. I'm ambivalent. Double set of tabs doesn't sound too compelling from a user perspective... Another thing, the whole panel takes up so much horizontal space, nearly a third of my monitors, there's room for improvement on the layout on this. |
…d to display the vertical scrollbar
I tried to refactor it using standard |
I strongly support more easily maintainable code, especially because GRASS depends on volunteers who often need to rotate in and out of coding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to block this, since it seems to fix a bug. Larger interface changes are needed to address this properly anyway.
Note I didn't actually tested this myself.
Agreed. I have tested. It does help the main window but is needed for other NVIZ windows too. Beyond that, as I noted, the main problem is that the NVIZ interface is simply too large and complicated to fit into a small pane in the single window interface. It would be a better solution to just have it launch in an independent window. |
Fixes #3224. Successfully tested on the macOS, MS Windows, GNU/Linux OS.
Screenshots
macOS
MS Windows
Additional context
Solution require complete different approach and contains one non-standard workaround. I found that the vertical scrollbar is showed on notebook pages that contain the
FoldPanelBar
widget, not because the standardSetVirtualSize()
method is called (is not working as expected), but because the nested scrolled panel with the horizontal scrollbar contains thewx.Choice
widget and after adding all the notebook pages it is called theUpdatePages()
method, in which theSetItems()
method is called for thewx.Choice
widget, which among other things, ensures the display of a vertical scroll bar (this applies to notebook page Data and Appearance, but the vertical scrollbar is not displayed for Analysis page because it does not contain thewx.Choce
widget).For this reason, I added a hidden
wx.Choice
widget to each notebook page that contains aFoldPanelBar
widget on the firstFoldPanel
widget which contains a horizontal scrollbar. After adding all the notebook pages, the hiddenwx.Choice
widgetsSetItem()
method is called, which ensures recalculation of theScrolledPanel
window size with a vertical scrollbar and displays it.Data notebook page ->
ScrolledPanel
with vertical scrollbar ->FoldPanelBar
-> SurfaceFoldPanel
->ScrolledPanel
with horizontal scrollbar -> hiddenChoice
widgetAppearance notebook page ->
ScrolledPanel
with vertical scrollbar ->FoldPanelBar
-> LightingFoldPanel
->ScrolledPanel
with horizontal scrollbar -> hiddenChoice
widgetAnalysis notebook page ->
ScrolledPanel
with vertical scrollbar ->FoldPanelBar
-> CuttingFoldPanel
->ScrolledPanel
with horizontal scrollbar -> hiddenChoice
widgetI couldn't find a better cleaner solution.
Could @cmbarton and @nilason test it and confirm expected behavior on macOS, please?