summaryrefslogtreecommitdiff
path: root/framework/source/uiconfiguration
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2016-10-30 16:24:37 +0100
committerTomaž Vajngerl <quikee@gmail.com>2016-10-30 18:00:05 +0000
commitb1426b5b502fd591402d666994e3f1fb3a8ad959 (patch)
tree3614d896993b004e805f9714a126070ec5d5c29f /framework/source/uiconfiguration
parent17b1ebbf86ceabe2e9cabf9626ca94fae3fb9216 (diff)
tdf#95014 initial support for 32 px icons in toolbar
This adds support for 32 pixel icons - mainly to get them into the toolbar. Most changes made are to change the behavior of having only small and large icons as a boolean choice, but not every code path was converted to non-boolean choice yet. Breeze icon theme has the 32px variants so it can be used already. Change-Id: Iadf832a87826c16b3a83522104dd6c35d61a0f87 Reviewed-on: https://gerrit.libreoffice.org/30398 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'framework/source/uiconfiguration')
-rw-r--r--framework/source/uiconfiguration/imagemanagerimpl.cxx37
1 files changed, 21 insertions, 16 deletions
diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index d229de961a33..bde487dfea39 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -64,10 +64,7 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::ui;
using namespace ::cppu;
-// Image sizes for our toolbars/menus
-const sal_Int32 IMAGE_SIZE_NORMAL = 16;
-const sal_Int32 IMAGE_SIZE_LARGE = 26;
-const sal_Int16 MAX_IMAGETYPE_VALUE = css::ui::ImageType::SIZE_LARGE;
+const sal_Int16 MAX_IMAGETYPE_VALUE = css::ui::ImageType::SIZE_32;
static const char IMAGE_FOLDER[] = "images";
static const char BITMAPS_FOLDER[] = "Bitmaps";
@@ -77,13 +74,15 @@ static const char ModuleImageList[] = "private:resource/images/moduleimage
static const o3tl::enumarray<vcl::ImageType, const char*> IMAGELIST_XML_FILE =
{
"sc_imagelist.xml",
- "lc_imagelist.xml"
+ "lc_imagelist.xml",
+ "xc_imagelist.xml"
};
static const o3tl::enumarray<vcl::ImageType, const char*> BITMAP_FILE_NAMES =
{
"sc_userimages.png",
- "lc_userimages.png"
+ "lc_userimages.png",
+ "xc_userimages.png"
};
namespace framework
@@ -221,8 +220,9 @@ bool GlobalImageList::hasImage( vcl::ImageType nImageType, const OUString& rComm
static bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& rOutGraphic, const uno::Reference< XGraphic >& rInGraphic, vcl::ImageType nImageType )
{
- static Size aNormSize( IMAGE_SIZE_NORMAL, IMAGE_SIZE_NORMAL );
- static Size aLargeSize( IMAGE_SIZE_LARGE, IMAGE_SIZE_LARGE );
+ static Size aNormSize(16, 16);
+ static Size aLargeSize(26, 26);
+ static Size aSize32(32, 32);
if ( !rInGraphic.is() )
{
@@ -235,12 +235,14 @@ static bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& rOutGraphic
Size aSize = aImage.GetSizePixel();
bool bMustScale( false );
- if ( nImageType == vcl::ImageType::Color_Large )
- bMustScale = ( aSize != aLargeSize );
+ if (nImageType == vcl::ImageType::Size26)
+ bMustScale = (aSize != aLargeSize);
+ else if (nImageType == vcl::ImageType::Size32)
+ bMustScale = (aSize != aSize32);
else
- bMustScale = ( aSize != aNormSize );
+ bMustScale = (aSize != aNormSize);
- if ( bMustScale )
+ if (bMustScale)
{
BitmapEx aBitmap = aImage.GetBitmapEx();
aBitmap.Scale( aNormSize );
@@ -249,15 +251,18 @@ static bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& rOutGraphic
}
else
rOutGraphic = rInGraphic;
+
return true;
}
static vcl::ImageType implts_convertImageTypeToIndex( sal_Int16 nImageType )
{
- vcl::ImageType nIndex( vcl::ImageType::Color );
- if ( nImageType & css::ui::ImageType::SIZE_LARGE )
- nIndex = vcl::ImageType::Color_Large;
- return nIndex;
+ if (nImageType & css::ui::ImageType::SIZE_LARGE)
+ return vcl::ImageType::Size26;
+ else if (nImageType & css::ui::ImageType::SIZE_32)
+ return vcl::ImageType::Size32;
+ else
+ return vcl::ImageType::Size16;
}
ImageList* ImageManagerImpl::implts_getUserImageList( vcl::ImageType nImageType )