summaryrefslogtreecommitdiff
path: root/framework/source/uielement/popuptoolbarcontroller.cxx
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/uielement/popuptoolbarcontroller.cxx
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/uielement/popuptoolbarcontroller.cxx')
-rw-r--r--framework/source/uielement/popuptoolbarcontroller.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/framework/source/uielement/popuptoolbarcontroller.cxx b/framework/source/uielement/popuptoolbarcontroller.cxx
index e3a840d5dd69..55d180ee815f 100644
--- a/framework/source/uielement/popuptoolbarcontroller.cxx
+++ b/framework/source/uielement/popuptoolbarcontroller.cxx
@@ -53,7 +53,18 @@
using namespace framework;
-namespace {
+namespace
+{
+
+vcl::ImageType getImageType(ToolBoxButtonSize eSize)
+{
+ vcl::ImageType eImageType = vcl::ImageType::Size16;
+ if (eSize == ToolBoxButtonSize::Large)
+ eImageType = vcl::ImageType::Size26;
+ else if (eSize == ToolBoxButtonSize::Size32)
+ eImageType = vcl::ImageType::Size32;
+ return eImageType;
+}
typedef cppu::ImplInheritanceHelper< svt::ToolboxController,
css::lang::XServiceInfo >
@@ -380,9 +391,10 @@ void GenericPopupToolbarController::functionExecuted( const OUString& rCommand )
pToolBox->SetHelpText( nId, OUString() ); // Will retrieve the new one from help.
pToolBox->SetItemText( nId, vcl::CommandInfoProvider::Instance().GetLabelForCommand( rCommand, m_xFrame ) );
pToolBox->SetQuickHelpText( nId, vcl::CommandInfoProvider::Instance().GetTooltipForCommand( rCommand, m_xFrame ) );
- Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( rCommand,
- pToolBox->GetToolboxButtonSize() == ToolBoxButtonSize::Large,
- m_xFrame );
+
+ vcl::ImageType eImageType = getImageType(pToolBox->GetToolboxButtonSize());
+
+ Image aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(rCommand, m_xFrame, eImageType);
if ( !!aImage )
pToolBox->SetItemImage( nId, aImage );
}
@@ -499,21 +511,22 @@ void SaveToolbarController::updateImage()
if ( !getToolboxId( nId, &pToolBox ) )
return;
- bool bLargeIcons = pToolBox->GetToolboxButtonSize() == ToolBoxButtonSize::Large;
+ vcl::ImageType eImageType = getImageType(pToolBox->GetToolboxButtonSize());
+
Image aImage;
if ( m_bReadOnly )
{
- aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( ".uno:SaveAs", bLargeIcons, m_xFrame );
+ aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(".uno:SaveAs", m_xFrame, eImageType);
}
else if ( m_bModified )
{
- Image aResImage( bLargeIcons ? FwkResId( IMG_SAVEMODIFIED_LARGE ) : FwkResId( IMG_SAVEMODIFIED_SMALL ) );
+ Image aResImage(eImageType == vcl::ImageType::Size16 ? FwkResId(IMG_SAVEMODIFIED_SMALL) : FwkResId(IMG_SAVEMODIFIED_LARGE));
aImage = aResImage;
}
if ( !aImage )
- aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand( m_aCommandURL, bLargeIcons, m_xFrame );
+ aImage = vcl::CommandInfoProvider::Instance().GetImageForCommand(m_aCommandURL, m_xFrame, eImageType);
if ( !!aImage )
pToolBox->SetItemImage( nId, aImage );