From: Peter Penz Date: Tue, 5 Jan 2010 16:17:34 +0000 (+0000) Subject: Prevent black borders when compositing has been disabled. X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d8d04037a085c7932df9eb1def130e56a43f370d?ds=inline Prevent black borders when compositing has been disabled. BUG: 219667 CCMAIL: sourtooth@gmail.com svn path=/trunk/KDE/kdebase/apps/; revision=1070424 --- diff --git a/src/tooltips/ktooltipwindow.cpp b/src/tooltips/ktooltipwindow.cpp index 7c9e0b2f0..a90973fb8 100644 --- a/src/tooltips/ktooltipwindow.cpp +++ b/src/tooltips/ktooltipwindow.cpp @@ -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)