summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2016-09-07 14:58:28 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-09-07 17:45:52 +0000
commit1fc1e8ed0c24ea545658ee6e4aabd40d74b7125f (patch)
tree492038dc4ec22b8bcc5ef4974452bb7894667327 /vcl
parent3b3feeff98385bccce14b83bf32f079f624550c6 (diff)
BigToolBox painting fix
If the button was dropdown only type the arrow was on the same position as a text. Change-Id: I3d9693ef57c5c2d27549987339a1c388bc3ff724 Reviewed-on: https://gerrit.libreoffice.org/28721 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/toolbox.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 5ca7454cb166..e9e539a963a1 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -3047,14 +3047,17 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos,
if( ImplGetSVData()->maNWFData.mbToolboxDropDownSeparate )
{
// separate button not for dropdown only where the whole button is painted
- if ( pItem->mnBits & ToolBoxItemBits::DROPDOWN &&
+ // exception: when text position is set to bottom then we want to calculate rect for dropdown only button
+ if ( ( pItem->mnBits & ToolBoxItemBits::DROPDOWN &&
((pItem->mnBits & ToolBoxItemBits::DROPDOWNONLY) != ToolBoxItemBits::DROPDOWNONLY) )
+ || ( ( pItem->mnBits & ToolBoxItemBits::DROPDOWN) && ( meTextPosition == ToolBoxTextPosition::Bottom ) ) )
{
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
- aBtnSize.Height() -= aArrowRect.GetHeight();
+ else if ( !( (meTextPosition == ToolBoxTextPosition::Bottom)
+ && ((pItem->mnBits & ToolBoxItemBits::DROPDOWNONLY) == ToolBoxItemBits::DROPDOWNONLY) ) )
+ aBtnSize.Height() -= aArrowRect.GetHeight(); // dropdown arrow on bottom side
}
}
@@ -3266,7 +3269,10 @@ void ToolBox::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos,
long nArrowHeight = ( pItem->mnBits & ToolBoxItemBits::DROPDOWN )
? TB_DROPDOWNARROWWIDTH : 0;
- if ( ImplGetSVData()->maNWFData.mbToolboxDropDownSeparate )
+ // only if buton is a "dropdown only" type then is painted as a single button
+ // and we need to move text above the arrow
+ if ( ImplGetSVData()->maNWFData.mbToolboxDropDownSeparate
+ && (pItem->mnBits & ToolBoxItemBits::DROPDOWNONLY) != ToolBoxItemBits::DROPDOWNONLY )
nArrowHeight = 0;
nTextOffY += nBtnHeight - aTxtSize.Height() - nArrowHeight;