From ea8d0dcce28177a5b9794930db65f287d0c20670 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Wed, 30 Nov 2011 15:44:29 +0100 Subject: [PATCH] get rid of the text halos they are (relatively) expensive and should be unnecessary now: we have blur, it works well, and when we don't blur we use different backgrounds. one more "take one thing off" while i'm futzing around in tooltips --- private/tooltip.cpp | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/private/tooltip.cpp b/private/tooltip.cpp index 64639703b..0ad437605 100644 --- a/private/tooltip.cpp +++ b/private/tooltip.cpp @@ -89,25 +89,13 @@ public: } m_document->adjustSize(); - m_haloRects.clear(); - QTextLayout *layout = m_document->begin().layout(); - //layout->setPosition(QPointF(textRect.x(), textBoundingRect->y())); - QTextLine line; - for (int i = 0; i < layout->lineCount(); ++i) { - line = layout->lineAt(i); - - // Add halo rect only when a non empty line is found - if (line.naturalTextWidth()) { - m_haloRects.append(line.naturalTextRect().translated(layout->position().toPoint()).toRect().translated(m_margin, m_margin)); - } - } - update(); } QSize minimumSizeHint() const { - return m_document->size().toSize() + QSize(m_margin, m_margin)*2; + const int margin = 6; + return m_document->size().toSize() + QSize(margin, margin)*2; } QSize maximumSizeHint() const @@ -118,14 +106,6 @@ public: void paintEvent(QPaintEvent *event) { QPainter p(this); - - if (Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor).value() < 128) { - foreach (const QRectF &rect, m_haloRects) { - Plasma::PaintUtils::drawHalo(&p, rect); - } - - p.translate(m_margin, m_margin); - } m_document->drawContents(&p, event->rect()); } @@ -155,8 +135,6 @@ private: ToolTip *m_toolTip; QTextDocument *m_document; QString m_anchor; - QList m_haloRects; - static const int m_margin = 6; }; class ToolTipPrivate