fixed wxSizer::SetSizeHints() to allow setting smaller size than before (e.g. when wxCollapsiblePane collapses)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -921,12 +921,16 @@ void wxSizer::SetSizeHints( wxWindow *window )
|
||||
// Preserve the window's max size hints, but set the
|
||||
// lower bound according to the sizer calculations.
|
||||
|
||||
wxSize size = Fit( window );
|
||||
// This is equivalent to calling Fit(), except that we need to set
|
||||
// the size hints _in between_ the two steps performed by Fit
|
||||
// (1. ComputeFittingClientSize, 2. SetClientSize). That's because
|
||||
// otherwise SetClientSize() could have no effect if there already are
|
||||
// size hints in effect that forbid requested client size.
|
||||
|
||||
window->SetSizeHints( size.x,
|
||||
size.y,
|
||||
window->GetMaxWidth(),
|
||||
window->GetMaxHeight() );
|
||||
const wxSize clientSize = ComputeFittingClientSize(window);
|
||||
|
||||
window->SetMinClientSize(clientSize);
|
||||
window->SetClientSize(clientSize);
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
|
Reference in New Issue
Block a user