From ddc2f0e6e59bb090e28f0503f35fe034d7e3b854 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Mon, 3 Mar 2008 19:53:13 +0000 Subject: [PATCH] don't expand unless we actually cross the threshold; this prevents, e.g. expanding when closing a window or moving from a window title bar to the canvas when the title bar overlaps the toolbox CCMAIL:panel-devel@kde.org svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=781885 --- desktoptoolbox.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/desktoptoolbox.cpp b/desktoptoolbox.cpp index 49dc3cb72..b00086503 100644 --- a/desktoptoolbox.cpp +++ b/desktoptoolbox.cpp @@ -159,6 +159,18 @@ void DesktopToolbox::hoverEnterEvent(QGraphicsSceneHoverEvent *event) QGraphicsItem::hoverEnterEvent(event); return; } + + QPainterPath path; + int size = m_size + (int)m_animFrame - 5; + path.moveTo(m_size*2, 0); + path.arcTo(QRectF(m_size * 2 - size, -size, size*2, size*2), 180, 90); + path.lineTo(m_size*2, 0); + + if (path.contains(event->pos())) { + QGraphicsItem::hoverEnterEvent(event); + return; + } + showToolbox(); QGraphicsItem::hoverEnterEvent(event); }