Disallow shrinking wxPreviewFrame too much horizontally

Make it at least as wide as the controls bar to ensure all the buttons
are always shown.
This commit is contained in:
Vadim Zeitlin 2022-05-21 00:04:03 +01:00
parent f96789c1fd
commit 5be09037d0

View File

@ -1771,6 +1771,13 @@ void wxPreviewFrame::InitializeWithModality(wxPreviewFrameModalityKind kind)
SetSizer( sizer );
sizer->Fit(this);
// We don't want to restrict shrinking the window vertically as it might be
// too tall (see SetInitialSize() call in wxPreviewCanvas ctor), but we do
// want to make it at least as wide as the control bar, as otherwise the
// buttons wouldn't fit, and restricting it to at least its height
// vertically is also quite reasonable.
SetSizeHints(m_controlBar->GetBestSize());
m_modalityKind = kind;
switch ( m_modalityKind )
{