From 7b5c62982dc57516f2e3a79be9b58068671d3100 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 7 Jan 2008 04:41:30 +0000 Subject: [PATCH] commit ryan's black border on tooltip patch so i can merge to the branch soon svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=758187 --- widgets/tooltip.cpp | 22 ++++++++++++++-------- widgets/tooltip_p.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/widgets/tooltip.cpp b/widgets/tooltip.cpp index 9631c2601..c30543bb8 100644 --- a/widgets/tooltip.cpp +++ b/widgets/tooltip.cpp @@ -252,20 +252,26 @@ void WindowPreview::setInfo() reinterpret_cast< unsigned char* >( data ), sizeof( data ) / sizeof( data[ 0 ] )); } -//Patterned after KickerTip -//TODO: Do something to antialias edges -//Reimplement paintEvent perhaps? -void ToolTip::resizeEvent(QResizeEvent *) + +void ToolTip::paintEvent(QPaintEvent *) { + QPainter painter(this); + painter.setRenderHint(QPainter::Antialiasing); + + // draw items QBitmap mask(width(), height()); - QPainter painter(&mask); + QPainter maskPainter(&mask); mask.fill(Qt::white); - painter.setBrush(Qt::black); - painter.setPen(Qt::black); - painter.drawPath(Plasma::roundedRectangle(mask.rect(), 10)); + maskPainter.setBrush(Qt::black); + maskPainter.setPen(Qt::black); + + maskPainter.drawPath(roundedRectangle(mask.rect(), 10)); setMask(mask); + + painter.setPen(Qt::black); + painter.drawPath(roundedRectangle(mask.rect(), 10)); } } diff --git a/widgets/tooltip_p.h b/widgets/tooltip_p.h index 0c8df8d3f..d21407d94 100644 --- a/widgets/tooltip_p.h +++ b/widgets/tooltip_p.h @@ -52,7 +52,7 @@ public: protected: virtual void showEvent( QShowEvent* ); - void resizeEvent(QResizeEvent */*event*/); + void paintEvent(QPaintEvent */*event*/); private Q_SLOTS: void slotResetTimer();