From 64b951fab3fc0dbbb1eedd9e35eb59ddbaa6da1f Mon Sep 17 00:00:00 2001 From: Takahiro Hashimoto Date: Tue, 29 Sep 2015 14:52:04 +0900 Subject: [PATCH] Make tooltip dialog hidden on the cursor entering the inactive ToolTipArea REVIEW: 125443 --- src/declarativeimports/core/tooltip.cpp | 9 ++++++--- tests/tooltip.qml | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp index 3ffcdbae9..a5e223b8b 100644 --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -332,9 +332,12 @@ void ToolTip::hoverEnterEvent(QHoverEvent *event) // and ask to keep it open for a bit, so other items get the chance // to update the content before the tooltip hides -- this avoids // flickering - tooltipDialogInstance()->keepalive(); - //FIXME: showToolTip needs to be renamed in sync or something like that - showToolTip(); + // It need to be considered only when other items can deal with tooltip area + if (m_active) { + tooltipDialogInstance()->keepalive(); + //FIXME: showToolTip needs to be renamed in sync or something like that + showToolTip(); + } } else { m_showTimer->start(m_interval); } diff --git a/tests/tooltip.qml b/tests/tooltip.qml index b153188e1..e36924fac 100644 --- a/tests/tooltip.qml +++ b/tests/tooltip.qml @@ -85,6 +85,26 @@ Rectangle { } } + PlasmaCore.ToolTipArea { + width: 300 + height: 50 + + active: false + + mainText: "A" + subText: "B" + + Rectangle { + color: "red" + anchors.fill: parent + } + + Text { + anchors.fill: parent + text: "tooltip exists but inactive" + } + } + PlasmaCore.ToolTipArea { width: 300 height: 50