diff options
| author | Peter Penz <[email protected]> | 2010-01-05 16:17:34 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2010-01-05 16:17:34 +0000 |
| commit | d8d04037a085c7932df9eb1def130e56a43f370d (patch) | |
| tree | aa75a09d1122cf318efcfe035c9eba5a8c5f88b0 | |
| parent | 6d24b182ead2b7ebf5b2b7a310bf3b8bc36e8e2c (diff) | |
Prevent black borders when compositing has been disabled.
BUG: 219667
CCMAIL: [email protected]
svn path=/trunk/KDE/kdebase/apps/; revision=1070424
| -rw-r--r-- | src/tooltips/ktooltipwindow.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
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; + 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(); + 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); + painter.drawPath(path); + } else { + painter.drawRect(rect); + } } void KToolTipWindow::arc(QPainterPath& path, qreal cx, qreal cy, qreal radius, qreal angle, qreal sweeplength) |
