From f4221b6df58b468c910041e6e13bff47053e68b1 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 25 Nov 2020 23:52:13 +0100 Subject: [PATCH] Improve GetSizeFromText in wxComboCtrl Also take default text indent into account, and use the actual button area width. Closes #18930. --- src/common/combocmn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index f833e0c0e3..aa0bc95fc5 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -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() );