Kaydet (Commit) 27d94c48 authored tarafından Caolán McNamara's avatar Caolán McNamara

color bar doesn't fill tool item

since

commit b8f21298
Author: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Date:   Mon Mar 2 20:57:32 2015 +0900

the color bar is always drawn under the icon and doesn't
get drawn to the right and fill all the empty space of
the tool item, e.g. in impress see the new toolbar color
selector

Change-Id: Ib70fec9c933b9d743e67475899938a5d9f405496
üst ea593a29
...@@ -379,6 +379,9 @@ public: ...@@ -379,6 +379,9 @@ public:
Rectangle GetItemRect( sal_uInt16 nItemId ) const; Rectangle GetItemRect( sal_uInt16 nItemId ) const;
Rectangle GetItemPosRect( sal_uInt16 nPos ) const; Rectangle GetItemPosRect( sal_uInt16 nPos ) const;
/// Returns size of the bitmap / text that is inside this toolbox item.
Size GetItemContentSize( sal_uInt16 nItemId ) const;
/// Retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown) /// Retrieves the optimal position to place a popup window for this item (subtoolbar or dropdown)
Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const; Point GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const;
......
...@@ -79,8 +79,7 @@ namespace svx ...@@ -79,8 +79,7 @@ namespace svx
void ToolboxButtonColorUpdater::Update(const Color& rColor) void ToolboxButtonColorUpdater::Update(const Color& rColor)
{ {
Image aImage(mpTbx->GetItemImageOriginal(mnBtnId)); Image aImage(mpTbx->GetItemImageOriginal(mnBtnId));
BitmapEx aSource(aImage.GetBitmapEx()); Size aItemSize(mpTbx->GetItemContentSize(mnBtnId));
Size aItemSize = aSource.GetSizePixel();
const bool bSizeChanged = (maBmpSize != aItemSize); const bool bSizeChanged = (maBmpSize != aItemSize);
const bool bDisplayModeChanged = (mbWasHiContrastMode != mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode()); const bool bDisplayModeChanged = (mbWasHiContrastMode != mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode());
...@@ -101,6 +100,7 @@ namespace svx ...@@ -101,6 +100,7 @@ namespace svx
sal_uInt8 nAlpha = 255; sal_uInt8 nAlpha = 255;
BitmapEx aBmpEx(Bitmap(aItemSize, 24), AlphaMask(aItemSize, &nAlpha)); BitmapEx aBmpEx(Bitmap(aItemSize, 24), AlphaMask(aItemSize, &nAlpha));
BitmapEx aSource(aImage.GetBitmapEx());
long nWidth = std::min(aItemSize.Width(), aSource.GetSizePixel().Width()); long nWidth = std::min(aItemSize.Width(), aSource.GetSizePixel().Width());
long nHeight = std::min(aItemSize.Height(), aSource.GetSizePixel().Height()); long nHeight = std::min(aItemSize.Height(), aSource.GetSizePixel().Height());
......
...@@ -935,6 +935,18 @@ sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const ...@@ -935,6 +935,18 @@ sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const
return 0; return 0;
} }
Size ToolBox::GetItemContentSize( sal_uInt16 nItemId ) const
{
if ( mbCalc || mbFormat )
((ToolBox*)this)->ImplFormat();
sal_uInt16 nPos = GetItemPos( nItemId );
if ( nPos < mpData->m_aItems.size() )
return mpData->m_aItems[nPos].maContentSize;
else
return Size();
}
sal_uInt16 ToolBox::GetItemId(const OUString &rCommand) const sal_uInt16 ToolBox::GetItemId(const OUString &rCommand) const
{ {
if (!mpData) if (!mpData)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment