diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-02 20:57:32 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-05 09:46:49 +0900 |
commit | b8f21298288890d52c06fef6c84441634c56c986 (patch) | |
tree | 3c295b87962a894fff700c31a2cb1b5f014ebdb4 /svx | |
parent | 2c40b082b585d0d4429f3f6915cf96a8f7914448 (diff) |
toolbox - preserve the orig. image + use it in menu & color update
In toolbox the images are scaled for HiDPI, which causes various
problems. This change preserves the original image and uses that
when adding images into the menu and also uses that when updating
the color related toolbox-es.
Change-Id: Ib7e7d82ccb1cd774e0e14dd6bab5626eaefea097
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbxcolorupdate.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx index 3c9a1efc21ed..27f9de9fedb2 100644 --- a/svx/source/tbxctrls/tbxcolorupdate.cxx +++ b/svx/source/tbxctrls/tbxcolorupdate.cxx @@ -78,8 +78,9 @@ namespace svx void ToolboxButtonColorUpdater::Update(const Color& rColor) { - Image aImage(mpTbx->GetItemImage(mnBtnId)); - Size aItemSize(mpTbx->GetItemContentSize(mnBtnId)); + Image aImage(mpTbx->GetItemImageOriginal(mnBtnId)); + BitmapEx aSource(aImage.GetBitmapEx()); + Size aItemSize = aSource.GetSizePixel(); const bool bSizeChanged = (maBmpSize != aItemSize); const bool bDisplayModeChanged = (mbWasHiContrastMode != mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode()); @@ -99,7 +100,7 @@ namespace svx // (so that it grows in case the original bitmap was smaller) sal_uInt8 nAlpha = 255; BitmapEx aBmpEx(Bitmap(aItemSize, 24), AlphaMask(aItemSize, &nAlpha)); - BitmapEx aSource(aImage.GetBitmapEx()); + long nWidth = std::min(aItemSize.Width(), aSource.GetSizePixel().Width()); long nHeight = std::min(aItemSize.Height(), aSource.GetSizePixel().Height()); |