BigToolBox: fixed drawing with gtk2
Button's width was equal to icon width when gtk2 was used
Change-Id: I34e5c5c36653365ac422667a69d89aa6a91340a1
Reviewed-on: https://gerrit.libreoffice.org/28361
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 4937e59..d50b3bf 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3050,7 +3050,7 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos,
if ( pItem->mnBits & ToolBoxItemBits::DROPDOWN &&
((pItem->mnBits & ToolBoxItemBits::DROPDOWNONLY) != ToolBoxItemBits::DROPDOWNONLY) )
{
Rectangle aArrowRect = pItem->GetDropDownRect( mbHorz );
Rectangle aArrowRect = pItem->GetDropDownRect( mbHorz && ( meTextPosition == ToolBoxTextPosition::Right ) );
if( aArrowRect.Top() == pItem->maRect.Top() ) // dropdown arrow on right side
aBtnSize.Width() -= aArrowRect.GetWidth();
else // dropdown arrow on bottom side
@@ -3265,6 +3265,10 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos,
{
long nArrowHeight = ( pItem->mnBits & ToolBoxItemBits::DROPDOWN )
? TB_DROPDOWNARROWWIDTH : 0;
if ( ImplGetSVData()->maNWFData.mbToolboxDropDownSeparate )
nArrowHeight = 0;
nTextOffY += nBtnHeight - aTxtSize.Height() - nArrowHeight;
}
}