Make picker control at least as high as the associated text and square.
Ensure that the height of the picker control is at least as big as the height of the associated text control and that it's at least as wide as it is high as it looks bad otherwise. Closes #13232. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
73be128174
commit
df5f11feee
@ -123,6 +123,16 @@ void wxPickerBase::PostCreation()
|
||||
// associated with it - in that case it defaults to 0
|
||||
m_sizer->Add(m_picker, HasTextCtrl() ? 0 : 1, GetDefaultPickerCtrlFlag(), 5);
|
||||
|
||||
// For aesthetic reasons, make sure the picker is at least as high as the
|
||||
// associated text control and is always at least square.
|
||||
const wxSize pickerBestSize(m_picker->GetBestSize());
|
||||
const wxSize textBestSize(m_text->GetBestSize());
|
||||
wxSize pickerMinSize;
|
||||
pickerMinSize.y = wxMax(pickerBestSize.y, textBestSize.y);
|
||||
pickerMinSize.x = wxMax(pickerMinSize.x, pickerMinSize.y);
|
||||
if ( pickerMinSize != pickerBestSize )
|
||||
m_picker->SetMinSize(pickerMinSize);
|
||||
|
||||
SetSizer(m_sizer);
|
||||
|
||||
SetInitialSize( GetMinSize() );
|
||||
|
Loading…
Reference in New Issue
Block a user