[Libreoffice-commits] core.git: svtools/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Dec 16 03:13:36 PST 2014


 svtools/source/control/tabbar.cxx |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 8e2eccb177b271c93b4560266365158cd3700463
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Dec 16 20:08:17 2014 +0900

    Tab bar: multiply the size of the plus icon if HiDPI is detected
    
    Change-Id: I6efaac9bd21ab986af77fed1a949d3d2b380e922

diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 610646c..90d3edc 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -1191,16 +1191,25 @@ public:
 
     void drawPlusImage()
     {
-        SvtResId id( BMP_LIST_ADD );
-        Image aPlusImg( id );
+        SvtResId aPlusImageId(BMP_LIST_ADD);
+        Image aPlusImage(aPlusImageId);
+
+        sal_Int32 aScaleFactor = mrParent.GetDPIScaleFactor();
+        if (aScaleFactor > 1)
+        {
+            BitmapEx aBitmap = aPlusImage.GetBitmapEx();
+            aBitmap.Scale(aScaleFactor, aScaleFactor, BMP_SCALE_FAST);
+            aPlusImage = Image(aBitmap);
+        }
+
         // Center the image within the bounding rectangle.
-        Size aSize = aPlusImg.GetSizePixel();
-        Point pt = maRect.TopLeft();
+        Size aSize = aPlusImage.GetSizePixel();
+        Point aPosition = maRect.TopLeft();
         long nXOffSet = (maRect.GetWidth() - aSize.Width()) / 2;
         long nYOffset = (maRect.GetHeight() - aSize.Height()) / 2;
-        pt += Point(nXOffSet, nYOffset);
-        pt.X() += 1;
-        mrParent.DrawImage(pt, aPlusImg);
+        aPosition += Point(nXOffSet, nYOffset);
+        aPosition.X() += 1;
+        mrParent.DrawImage(aPosition, aPlusImage);
     }
 
     void setRect(const Rectangle& rRect)


More information about the Libreoffice-commits mailing list