diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2017-10-08 00:15:56 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2017-10-08 19:58:16 +0200 |
commit | 0112fa78b7867f0592e3bb2fb3babd76b91594ae (patch) | |
tree | 24b0f1b9c0f133431eda784c0c8e49144ca3d48b | |
parent | bef9aeb9c4c4e9641cfcaccbcea52ce1a87b6550 (diff) |
tdf#106642 Wide color buttons are only for the sidebar
Change-Id: I3c75495b0f450ccf0eb8f9de715c7c7befc7bbe6
Reviewed-on: https://gerrit.libreoffice.org/43238
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
-rw-r--r-- | include/svx/tbxcolorupdate.hxx | 5 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbxcolorupdate.cxx | 7 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/svx/tbxcolorupdate.hxx b/include/svx/tbxcolorupdate.hxx index 4dc21b9b45ce..5fad1c3dc759 100644 --- a/include/svx/tbxcolorupdate.hxx +++ b/include/svx/tbxcolorupdate.hxx @@ -43,9 +43,7 @@ namespace svx class SVX_DLLPUBLIC ToolboxButtonColorUpdater { public: - ToolboxButtonColorUpdater( sal_uInt16 nSlotId, - sal_uInt16 nTbxBtnId, - ToolBox* ptrTbx); + ToolboxButtonColorUpdater( sal_uInt16 nSlotId, sal_uInt16 nTbxBtnId, ToolBox* ptrTbx, bool bWideButton = false); ~ToolboxButtonColorUpdater(); void Update( const Color& rColor, bool bForceUpdate = false ); @@ -55,6 +53,7 @@ namespace svx ToolboxButtonColorUpdater(ToolboxButtonColorUpdater &) = delete; void operator =(ToolboxButtonColorUpdater) = delete; + bool mbWideButton; sal_uInt16 mnBtnId; sal_uInt16 mnSlotId; VclPtr<ToolBox> mpTbx; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 08333b13c2cf..fe75a925220c 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2810,7 +2810,7 @@ void SvxColorToolBoxControl::initialize( const css::uno::Sequence<css::uno::Any> // Sidebar uses wide buttons for those. m_bSplitButton = typeid( *pToolBox ) != typeid( sfx2::sidebar::SidebarToolBox ); - m_xBtnUpdater.reset( new svx::ToolboxButtonColorUpdater( m_nSlotId, nId, pToolBox ) ); + m_xBtnUpdater.reset( new svx::ToolboxButtonColorUpdater( m_nSlotId, nId, pToolBox, !m_bSplitButton ) ); pToolBox->SetItemBits( nId, pToolBox->GetItemBits( nId ) | ( m_bSplitButton ? ToolBoxItemBits::DROPDOWN : ToolBoxItemBits::DROPDOWNONLY ) ); } diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index 7c89b1edd6f2..698f334de723 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -30,8 +30,9 @@ namespace svx { ToolboxButtonColorUpdater::ToolboxButtonColorUpdater( - sal_uInt16 nId, sal_uInt16 nTbxBtnId, ToolBox* pToolBox) - : mnBtnId(nTbxBtnId) + sal_uInt16 nId, sal_uInt16 nTbxBtnId, ToolBox* pToolBox, bool bWideButton) + : mbWideButton(bWideButton) + , mnBtnId(nTbxBtnId) , mnSlotId(nId) , mpTbx(pToolBox) , maCurColor(COL_TRANSPARENT) @@ -69,7 +70,7 @@ namespace svx void ToolboxButtonColorUpdater::Update(const Color& rColor, bool bForceUpdate) { Image aImage(mpTbx->GetItemImage(mnBtnId)); - Size aItemSize(mpTbx->GetItemContentSize(mnBtnId)); + Size aItemSize(mbWideButton ? mpTbx->GetItemContentSize(mnBtnId) : aImage.GetSizePixel()); const bool bSizeChanged = (maBmpSize != aItemSize); const bool bDisplayModeChanged = (mbWasHiContrastMode != mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode()); |