Also make SetMinSize() after wxSizer::Fit() work correctly

This fixes a problem similar to that fixed in the previous commit but
for SetMinSize(), which was also ignored if done after calling
wxSizer::Fit() and before showing the window, as the explicitly set min
size was also overwritten by the pending min size computed from the
client size corresponding to the sizer fitting size.

The fix is similar too: just invalidate the pending minimum size if
SetMinSize() is called.
This commit is contained in:
Vadim Zeitlin
2021-04-12 18:09:37 +02:00
parent 645e1d2fd0
commit b5a78fbac6
2 changed files with 10 additions and 0 deletions

View File

@@ -141,6 +141,8 @@ public:
#ifdef __WXGTK3__
void GTKUpdateClientSizeIfNecessary();
virtual void SetMinSize(const wxSize& minSize) wxOVERRIDE;
virtual void WXSetInitialFittingClientSize(int flags) wxOVERRIDE;
private:

View File

@@ -1568,6 +1568,14 @@ void wxTopLevelWindowGTK::GTKUpdateClientSizeIfNecessary()
}
}
void wxTopLevelWindowGTK::SetMinSize(const wxSize& minSize)
{
wxTopLevelWindowBase::SetMinSize(minSize);
// Explicitly set minimum size should override the pending size, if any.
m_pendingFittingClientSizeFlags &= ~wxSIZE_SET_MIN;
}
void wxTopLevelWindowGTK::WXSetInitialFittingClientSize(int flags)
{
// In any case, update the size immediately.