summaryrefslogtreecommitdiff
path: root/svx/source/stbctrls/xmlsecctrl.cxx
diff options
context:
space:
mode:
authorKeith Curtis <keithcu@gmail.com>2013-12-20 14:19:19 +0100
committerJan Holesovsky <kendy@collabora.com>2013-12-20 14:23:35 +0100
commit7347482cc360ad3dc9ed77047441c2e30476fed3 (patch)
tree7f56a9063dea777562d797ae720cd58d2b4e7de4 /svx/source/stbctrls/xmlsecctrl.cxx
parenta130de7e00bb426b15ec3b0ffc6bffc652d174ab (diff)
hidpi: Make many places Hi-DPI aware.
This also introduces a getter for the mnDPIScaleFactor variable. Change-Id: I02ba6858fb1842f911d62976f4c54afc3bfa337f
Diffstat (limited to 'svx/source/stbctrls/xmlsecctrl.cxx')
-rw-r--r--svx/source/stbctrls/xmlsecctrl.cxx25
1 files changed, 22 insertions, 3 deletions
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx
index b2e2eb9a0b89..46ea35b8b167 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -60,6 +60,23 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId, sal_uInt16
mpImpl->maImage = Image( SVX_RES( RID_SVXBMP_SIGNET ) );
mpImpl->maImageBroken = Image( SVX_RES( RID_SVXBMP_SIGNET_BROKEN ) );
mpImpl->maImageNotValidated = Image( SVX_RES( RID_SVXBMP_SIGNET_NOTVALIDATED ) );
+
+ if (_rStb.GetDPIScaleFactor() > 1)
+ {
+ Image arr[3] = {mpImpl->maImage, mpImpl->maImageBroken, mpImpl->maImageNotValidated};
+
+ for (int i = 0; i < 3; i++)
+ {
+ BitmapEx b = arr[i].GetBitmapEx();
+ b.Scale(_rStb.GetDPIScaleFactor(), _rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
+ arr[i] = Image(b);
+ }
+
+ mpImpl->maImage = arr[0];
+ mpImpl->maImageBroken = arr[1];
+ mpImpl->maImageNotValidated = arr[2];
+ }
+
}
XmlSecStatusBarControl::~XmlSecStatusBarControl()
@@ -135,20 +152,22 @@ void XmlSecStatusBarControl::Paint( const UserDrawEvent& rUsrEvt )
pDev->SetLineColor();
pDev->SetFillColor( pDev->GetBackground().GetColor() );
+ long yOffset = (aRect.GetHeight() - mpImpl->maImage.GetSizePixel().Height()) / 2;
+
if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_OK )
{
- ++aRect.Top();
+ aRect.Top() += yOffset;
pDev->DrawImage( aRect.TopLeft(), mpImpl->maImage );
}
else if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_BROKEN )
{
- ++aRect.Top();
+ aRect.Top() += yOffset;
pDev->DrawImage( aRect.TopLeft(), mpImpl->maImageBroken );
}
else if( mpImpl->mnState == SIGNATURESTATE_SIGNATURES_NOTVALIDATED
|| mpImpl->mnState == SIGNATURESTATE_SIGNATURES_PARTIAL_OK)
{
- ++aRect.Top();
+ aRect.Top() += yOffset;
pDev->DrawImage( aRect.TopLeft(), mpImpl->maImageNotValidated );
}
else