summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/toolbox.cxx5
-rw-r--r--vcl/source/window/toolbox2.cxx24
2 files changed, 18 insertions, 11 deletions
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 6ad9c21822fe..5095ef21ed45 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -1671,9 +1671,8 @@ bool ToolBox::ImplCalcItem()
long nDropDownArrowWidth = TB_DROPDOWNARROWWIDTH;
// set defaults if image or text is needed but empty
- float fDPIScaleFactor = GetDPIScaleFactor();
- nDefWidth = GetDefaultImageSize().Width() * fDPIScaleFactor;
- nDefHeight = GetDefaultImageSize().Height() * fDPIScaleFactor;
+ nDefWidth = GetDefaultImageSize().Width();
+ nDefHeight = GetDefaultImageSize().Height();
mnWinHeight = 0;
// determine minimum size necessary in NWF
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 38d8dd7a4531..73af1121e980 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -633,20 +633,28 @@ ToolBoxButtonSize ToolBox::GetToolboxButtonSize() const
return mpData->meButtonSize;
}
-/*static*/ Size ToolBox::GetDefaultImageSize(bool bLarge)
+/*static*/ Size ToolBox::GetDefaultImageSize(ToolBoxButtonSize eToolBoxButtonSize)
{
- const long TB_SMALLIMAGESIZE = 16;
- if (!bLarge) {
- return Size(TB_SMALLIMAGESIZE, TB_SMALLIMAGESIZE);
- }
+ float fScaleFactor = Application::GetDefaultDevice()->GetDPIScaleFactor();
+
+ Size aUnscaledSize = Size(16, 16);
- OUString iconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme();
- return vcl::IconThemeInfo::SizeByThemeName(iconTheme);
+ if (eToolBoxButtonSize == ToolBoxButtonSize::Large)
+ {
+ OUString iconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme();
+ aUnscaledSize = vcl::IconThemeInfo::SizeByThemeName(iconTheme);
+ }
+ else if (eToolBoxButtonSize == ToolBoxButtonSize::Size32)
+ {
+ aUnscaledSize = Size(32, 32);
+ }
+ return Size(aUnscaledSize.Width() * fScaleFactor,
+ aUnscaledSize.Height() * fScaleFactor);
}
Size ToolBox::GetDefaultImageSize() const
{
- return GetDefaultImageSize( GetToolboxButtonSize() == ToolBoxButtonSize::Large );
+ return GetDefaultImageSize(GetToolboxButtonSize());
}
void ToolBox::SetAlign( WindowAlign eNewAlign )