wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
469 stars 98 forks source link

settings / preferences window collapses if tab is changed #1480

Open MSoegtropIMC opened 3 years ago

MSoegtropIMC commented 3 years ago

On macOS a recent wxMaxima compile (master from about 2 weeks ago) has an issue that when the tab is changed in the preferences window, the window collapses to a minimum size. One can resize the window again, but this is rather confusing / inconvenient. Also this used to work (with a rather old build from April 2020).

gunterkoenigsmann commented 3 years ago

I'll see what I can do about that: Normally the window was a fixed-size one without scrollbars, which depending on the font size might be suboptimal. Now in theory it should be a very flexible window with a fixed minimum size, instead...

MSoegtropIMC commented 3 years ago

I can see how I handle this in my wxWidgets app (didn't touch them for a while). It might be that you have to call Layout() and CalcMin() for all panels and take the maximum manually - I guess you are exchanging the panels dynamically. I might have something similar in my code.

gunterkoenigsmann commented 3 years ago

I've now equipped both the window and the wxBook inside it with a minimum size. Hope that wxWidgets respects at least one of these minimum size infos on the mac, too.

MSoegtropIMC commented 3 years ago

@gunterkoenigsmann : I just did a master build (d97dc9d108fb5ea8c41327c1492ebc07bf80dfcc) and the issue is still there. Let me see if I can fix it.

MSoegtropIMC commented 3 years ago

@gunterkoenigsmann : I have one question: I see some lines m_maximaEnvVariables->GetParent()->GetParent()->Layout(); in ConfigDialogue.cpp. This is not safe if you have SetLayoutAdaptationMode(wxDIALOG_ADAPTATION_MODE_ENABLED);, because this option allows wxWidgets to insert scroll windows into the windows hierarchy. See e.g. in (https://docs.wxwidgets.org/3.0/overview_dialog.html) the sentence "The dialog implementation makes assumptions about the window hierarchy".

I am used to DialogBlocks for my wxWidgets apps and find the manual dialog code rather hard to understand - in terms of what the resulting window and sizer structure is. So can you please check if this does what it should assuming scroll windows might be inserted in various places (it depends on if you have default buttons and panels in the dialog where scroll windows are inserted).