Adjust picker button size for generic wxDirPickerCtrl and wxFilePickerCtrl
For generic wx{Dir|File}PickerCtrl with text field the picker button should be as high as the associated text field also when wx{FLP|DIRP}_SMALL flag is set. Closes #19087.
This commit is contained in:
@@ -107,18 +107,22 @@ void wxPickerBase::PostCreation()
|
|||||||
|
|
||||||
// For aesthetic reasons, make sure the picker is at least as high as the
|
// For aesthetic reasons, make sure the picker is at least as high as the
|
||||||
// associated text control and is always at least square, unless we are
|
// associated text control and is always at least square, unless we are
|
||||||
// explicitly using wxPB_SMALL style to force it to take as little space as
|
// explicitly using wxPB_SMALL style to force it to take as little
|
||||||
// possible.
|
// horizontal space as possible.
|
||||||
if ( !HasFlag(wxPB_SMALL) )
|
const wxSize pickerBestSize(m_picker->GetBestSize());
|
||||||
|
const wxSize textBestSize( HasTextCtrl() ? m_text->GetBestSize() : wxSize());
|
||||||
|
wxSize pickerMinSize;
|
||||||
|
pickerMinSize.y = wxMax(pickerBestSize.y, textBestSize.y);
|
||||||
|
if ( HasFlag(wxPB_SMALL) )
|
||||||
{
|
{
|
||||||
const wxSize pickerBestSize(m_picker->GetBestSize());
|
pickerMinSize.x = pickerBestSize.x;
|
||||||
const wxSize textBestSize( HasTextCtrl() ? m_text->GetBestSize() : wxSize());
|
|
||||||
wxSize pickerMinSize;
|
|
||||||
pickerMinSize.y = wxMax(pickerBestSize.y, textBestSize.y);
|
|
||||||
pickerMinSize.x = wxMax(pickerBestSize.x, pickerMinSize.y);
|
|
||||||
if ( pickerMinSize != pickerBestSize )
|
|
||||||
m_picker->SetMinSize(pickerMinSize);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pickerMinSize.x = wxMax(pickerBestSize.x, pickerMinSize.y);
|
||||||
|
}
|
||||||
|
if ( pickerMinSize != pickerBestSize )
|
||||||
|
m_picker->SetMinSize(pickerMinSize);
|
||||||
|
|
||||||
SetSizer(m_sizer);
|
SetSizer(m_sizer);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user