]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Prevent black borders when compositing has been disabled.
authorPeter Penz <peter.penz19@gmail.com>
Tue, 5 Jan 2010 16:17:34 +0000 (16:17 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 5 Jan 2010 16:17:34 +0000 (16:17 +0000)
BUG: 219667
CCMAIL: sourtooth@gmail.com

svn path=/trunk/KDE/kdebase/apps/; revision=1070424

src/tooltips/ktooltipwindow.cpp

index 7c9e0b2f00fc750b97448e68a6a8cfcfec6894c2..a90973fb8c11c67a4f3f867726ab29fa0d2e0685 100644 (file)
@@ -72,17 +72,21 @@ void KToolTipWindow::paintEvent(QPaintEvent* event)
     painter.setBrush(gradient);
 
     const QRect rect(0, 0, width(), height());
-    const qreal radius = 5;
-
-    QPainterPath path;
-    path.moveTo(rect.left(), rect.top() + radius);
-    arc(path, rect.left()  + radius, rect.top()    + radius, radius, 180, -90);
-    arc(path, rect.right() - radius, rect.top()    + radius, radius,  90, -90);
-    arc(path, rect.right() - radius, rect.bottom() - radius, radius,   0, -90);
-    arc(path, rect.left()  + radius, rect.bottom() - radius, radius, 270, -90);
-    path.closeSubpath();
-
-    painter.drawPath(path);
+    if (haveAlphaChannel) {
+        const qreal radius = 5.0;
+
+        QPainterPath path;
+        path.moveTo(rect.left(), rect.top() + radius);
+        arc(path, rect.left()  + radius, rect.top()    + radius, radius, 180, -90);
+        arc(path, rect.right() - radius, rect.top()    + radius, radius,  90, -90);
+        arc(path, rect.right() - radius, rect.bottom() - radius, radius,   0, -90);
+        arc(path, rect.left()  + radius, rect.bottom() - radius, radius, 270, -90);
+        path.closeSubpath();
+
+        painter.drawPath(path);
+    } else {
+        painter.drawRect(rect);
+    }
 }
 
 void KToolTipWindow::arc(QPainterPath& path, qreal cx, qreal cy, qreal radius, qreal angle, qreal sweeplength)