X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93f7f8be7ee1df8f5d449a072036f2433a387ab9..2fbb8fbbed4e8a15bed1cd539d0f51eac3019658:/src/msw/combo.cpp?ds=inline diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index 7ebac8b6aa..401dc1033d 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -239,9 +239,12 @@ static void wxMSWDrawFocusRect( wxDC& dc, const wxRect& rect ) } // draw focus background on area in a way typical on platform -void wxComboCtrl::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) +void wxComboCtrl::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) const { wxUxThemeEngine* theme = (wxUxThemeEngine*) NULL; + + // Constructor only calls GetHWND() const, so it should be safe + // to cast "this" to const. wxUxThemeHandle hTheme(this, L"COMBOBOX"); //COLORREF cref; @@ -295,8 +298,14 @@ void wxComboCtrl::DrawFocusBackground( wxDC& dc, const wxRect& rect, int flags ) wxRect selRect(rect); selRect.y += focusSpacingY; selRect.height -= (focusSpacingY*2); - selRect.x += m_widthCustomPaint + focusSpacingX; - selRect.width -= m_widthCustomPaint + (focusSpacingX*2); + + int wcp = 0; + + if ( !(flags & wxCONTROL_ISSUBMENU) ) + wcp += m_widthCustomPaint; + + selRect.x += wcp + focusSpacingX; + selRect.width -= wcp + (focusSpacingX*2); if ( hTheme ) theme = wxUxThemeEngine::GetIfActive();