summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-07-05 16:25:49 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-07-05 17:11:45 +0100
commit5ab07df58bcc33423fabba2d0363cdde6a51f566 (patch)
tree92183960d0face35e52db85dd3418945c1fa527e
parent05f0859afba779ce28d24e3195d8266d616259d1 (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
-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 e3e2ff866350..ace9ea7233f3 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -571,6 +571,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 412fe331897a..05afd1a33bd3 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -982,7 +982,7 @@ ToolBoxButtonSize ToolBox::GetToolboxButtonSize() const
// -----------------------------------------------------------------------
-const Size& ToolBox::GetDefaultImageSize() const
+const Size& ToolBox::GetDefaultImageSize(bool bLarge)
{
static Size aSmallButtonSize( TB_SMALLIMAGESIZE, TB_SMALLIMAGESIZE );
@@ -995,6 +995,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;
@@ -1004,12 +1007,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 );
}
// -----------------------------------------------------------------------