From 4881ec4acc4320475c154a07be2fe74a571f3f4c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 24 May 2013 12:02:01 +0100 Subject: sync the menubutton size request and draw calculations Change-Id: I122254532dfe8ecd9c3118622bf24b50f885a0f6 --- vcl/source/control/button.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 4254113aef7c..78a600b184ec 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -1678,11 +1678,14 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const aSize = Size( 16, 12 ); else aSize = Size( 26, 24 ); - if( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON ) - aSize.Width() += 4; } else if ( IsImage() && ! (ImplGetButtonState() & BUTTON_DRAW_NOIMAGE) ) aSize = GetModeImage().GetSizePixel(); + if( mnDDStyle == PUSHBUTTON_DROPDOWN_MENUBUTTON ) + { + long nSymbolSize = GetTextHeight() / 2 + 1; + aSize.Width() += 2*nSymbolSize; + } if ( !PushButton::GetText().isEmpty() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) { sal_uLong nDrawFlags = 0; -- cgit