[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/pager
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2008-12-23 18:32:39
Message-ID: 1230057159.824409.21865.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 900827 by aseigo:

fix text placement
BUG:178567


 M  +21 -2     pager.cpp  


--- trunk/KDE/kdebase/workspace/plasma/applets/pager/pager.cpp #900826:900827
@@ -1071,9 +1071,28 @@
         }
 
         if (!desktopText.isEmpty()) {
-            QPixmap result = Plasma::PaintUtils::shadowText(desktopText, \
defaultTextColor, shadowColor, QPoint(1,2), 2); +            int radius = 2;
+            QPixmap result = Plasma::PaintUtils::shadowText(desktopText,
+                                                            \
KGlobalSettings::smallestReadableFont(), +                                            \
defaultTextColor, +                                                            \
shadowColor, QPoint(0, 0), radius); +            QRectF target = m_rects[i];
             //take also shadow position and radius into account
-            painter->drawPixmap(m_rects[i].center() - result.rect().center() + \
QPoint(0, 1), result); +            //kDebug() << target << result.height();
+            if (target.height() >= result.height() - radius * 2) {
+                QPointF paintPoint = target.center() - (result.rect().center() + \
QPoint(radius, radius));  +
+                if (paintPoint.x() + radius < target.x() + 1) {
+                    paintPoint.setX(target.x() + 1 - radius);
+                }
+
+                if (paintPoint.y() + radius < target.y() + 1) {
+                    paintPoint.setY(target.y() + 1 - radius);
+                }
+
+                target.moveTopLeft(QPointF(0, 0));
+                painter->drawPixmap(paintPoint, result, target);
+            }
         }
     }
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic