From d207025d8febc580c726580c2beb08ca9c86abf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Thu, 4 Apr 2013 16:00:57 +0200 Subject: [PATCH] Blur behind for tooltips Also clean up flags a bit. --- src/declarativeimports/core/tooltip.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp index 0dc9b78ac..08e7cea67 100644 --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -25,6 +25,9 @@ #include #include +#include "framesvgitem.h" +#include + ToolTipWindow::ToolTipWindow(QWindow *parent) : QQuickWindow(parent), m_mainText(""), m_subText(""), m_widget(0) { @@ -33,12 +36,7 @@ ToolTipWindow::ToolTipWindow(QWindow *parent) setFormat(format); setClearBeforeRendering(true); setColor(QColor(Qt::transparent)); - setFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint | Qt::ToolTip); - //setAttribute - //setAttribute(Qt::WA_X11NetWmWindowTypeToolTip, true) -// tooltipDialog.windowFlags = Qt.Window|Qt.WindowStaysOnTopHint|Qt.X11BypassWindowManagerHint - - //m_flags = flags(); + setFlags(Qt::ToolTip); m_syncTimer = new QTimer(this); m_syncTimer->setSingleShot(true); @@ -82,6 +80,11 @@ void ToolTipWindow::syncGeometry() qDebug() << "XXXX mainitem : " << mainItem()->width() << mainItem()->height(); resize(mainItem()->width(), mainItem()->height()); setPosition(popupPosition(visualParent())); + + Plasma::FrameSvgItem *frameSvg = qobject_cast(mainItem()); + if (frameSvg) { + KWindowEffects::enableBlurBehind(winId(), true, frameSvg->frameSvg()->mask()); + } } QString ToolTipWindow::mainText() const