summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-07-05 16:25:49 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-07-08 08:57:38 +0000
commit0784de21830d34a47ece9aae2dfd1db99f04d301 (patch)
tree87f6d740ce2807b9320e3ff4f8b75d463ec10b26
parent5456cddf0ae6ca16c107834216371898764147f8 (diff)
fdo#66524 - export a means of detecting preferred icon size for toolbars.
Also fix human / tango / and other icon theme item sizing. Change-Id: I7039f8f671834237a7ec9b2e4b5227e9c47e7143 Reviewed-on: https://gerrit.libreoffice.org/4744 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--include/vcl/toolbox.hxx1
-rw-r--r--vcl/source/window/toolbox2.cxx13
2 files changed, 12 insertions, 2 deletions
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 702f81920329..f27c721348f7 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -567,6 +567,7 @@ public:
// if an index is found the corresponding item id is filled in (else 0)
long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
+ static const Size& GetDefaultImageSize(bool bLarge);
const Size& GetDefaultImageSize() const;
void ChangeHighlight( sal_uInt16 nPos );
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 6634361a42db..053def35445a 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -973,7 +973,7 @@ ToolBoxButtonSize ToolBox::GetToolboxButtonSize() const
// -----------------------------------------------------------------------
-const Size& ToolBox::GetDefaultImageSize() const
+const Size& ToolBox::GetDefaultImageSize(bool bLarge)
{
static Size aSmallButtonSize( TB_SMALLIMAGESIZE, TB_SMALLIMAGESIZE );
@@ -986,6 +986,9 @@ const Size& ToolBox::GetDefaultImageSize() const
s_nSymbolsStyle = nSymbolsStyle;
switch ( nSymbolsStyle )
{
+ case STYLE_SYMBOLS_TANGO:
+ case STYLE_SYMBOLS_TANGO_TESTING:
+ case STYLE_SYMBOLS_HUMAN:
case STYLE_SYMBOLS_INDUSTRIAL:
aLargeButtonSize = Size( TB_LARGEIMAGESIZE_INDUSTRIAL, TB_LARGEIMAGESIZE_INDUSTRIAL );
break;
@@ -995,12 +998,18 @@ const Size& ToolBox::GetDefaultImageSize() const
case STYLE_SYMBOLS_OXYGEN:
aLargeButtonSize = Size( TB_LARGEIMAGESIZE_OXYGEN, TB_LARGEIMAGESIZE_OXYGEN );
break;
+ case STYLE_SYMBOLS_DEFAULT: // galaxy
+ case STYLE_SYMBOLS_HICONTRAST:
default:
aLargeButtonSize = Size( TB_LARGEIMAGESIZE, TB_LARGEIMAGESIZE );
}
}
+ return bLarge ? aLargeButtonSize : aSmallButtonSize;
+}
- return GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE ? aLargeButtonSize : aSmallButtonSize;
+const Size& ToolBox::GetDefaultImageSize() const
+{
+ return GetDefaultImageSize( GetToolboxButtonSize() == TOOLBOX_BUTTONSIZE_LARGE );
}
// -----------------------------------------------------------------------