if a qmenu is open the handle doesn't disappear, make it disappear as

soon as the menu closes, this way it doesn't steal anymore the focus to
the applet
BUG:180752

svn path=/trunk/KDE/kdelibs/; revision=948256
This commit is contained in:
Marco Martin 2009-04-02 16:43:41 +00:00
parent 94dcdc31a4
commit dbc4852624

View File

@ -25,6 +25,7 @@
#include <QtGui/QLinearGradient>
#include <QtGui/QPainter>
#include <QtGui/QApplication>
#include <QtGui/QMenu>
#include <kcolorscheme.h>
#include <kglobalsettings.h>
@ -791,6 +792,15 @@ void AppletHandle::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event);
foreach (QWidget *widget, QApplication::topLevelWidgets()) {
QMenu *menu = qobject_cast<QMenu*>(widget);
if (menu && menu->isVisible()) {
connect(menu, SIGNAL(aboutToHide()), this, SLOT(leaveTimeout()));
return;
}
}
// if we haven't even showed up yet, remove the handle
if (m_hoverTimer->isActive()) {
m_hoverTimer->stop();