diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2014-12-26 20:33:34 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2014-12-26 20:42:12 +0900 |
commit | 8a009858aa25825e26eb9f04ea1d3620445e6709 (patch) | |
tree | 9a3e4aea95a7f708cc73c81e8b6c33a6cd747719 /vcl/source/window | |
parent | f37ccf3ed8aae4e2d5191fb97aa28446541ff790 (diff) |
Adjust the statusbar item widths according to HiDPI scaling factor
Change-Id: Id697b3b799c7437d937de6534edf88083e5c4dfd
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/status.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 8583e5fbf971..2b74883b2abd 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -129,6 +129,7 @@ void StatusBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) mbVisibleItems = true; mbProgressMode = false; mbInUserDraw = false; + mbAdjustHiDPI = false; mnItemsWidth = STATUSBAR_OFFSET_X; mnDX = 0; mnDY = 0; @@ -161,6 +162,11 @@ StatusBar::~StatusBar() delete mpImplData; } +void StatusBar::AdjustItemWidthsForHiDPI(bool bAdjustHiDPI) +{ + mbAdjustHiDPI = bAdjustHiDPI; +} + void StatusBar::ImplInitSettings( bool bFont, bool bForeground, bool bBackground ) { @@ -899,6 +905,10 @@ void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth, nBits |= SIB_CENTER; // create item + if (mbAdjustHiDPI && GetDPIScaleFactor() != 1) + { + nWidth *= GetDPIScaleFactor(); + } long nFudge = GetTextHeight()/4; ImplStatusItem* pItem = new ImplStatusItem; pItem->mnId = nItemId; |