Improve GetSizeFromText in wxComboCtrl

Also take default text indent into account, and use the actual button area width.

Closes #18930.
This commit is contained in:
Maarten Bent
2020-11-25 23:52:13 +01:00
parent f4dcac9f44
commit f4221b6df5

View File

@@ -1457,7 +1457,7 @@ wxSize wxComboCtrlBase::DoGetSizeFromTextSize(int xlen, int ylen) const
fhei += 2 * FOCUS_RING;
// Calculate width
int fwid = xlen + FOCUS_RING + COMBO_MARGIN + DEFAULT_DROPBUTTON_WIDTH;
int fwid = GetNativeTextIndent() + xlen + FOCUS_RING + COMBO_MARGIN + m_btnArea.width;
// Add the margins we have previously set
wxPoint marg( GetMargins() );