summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoann Laissus <yoann.laissus@gmail.com>2011-06-09 00:46:13 +0200
committerYoann Laissus <yoann.laissus@gmail.com>2011-06-09 00:46:13 +0200
commitae5c67f92e8b7acba5ce6db22c7d32d52910e311 (patch)
treeebf75ee5fc0a00f48e1273decc3c018f31d22088
parentrekonq 0.7.52 (diff)
downloadrekonq-ae5c67f92e8b7acba5ce6db22c7d32d52910e311.tar.xz
Don't close Bookmark Toolbar's subfolders on a click
BUG: 275155
-rw-r--r--src/bookmarks/bookmarkstoolbar.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp
index 585c29a2..b3ee8b18 100644
--- a/src/bookmarks/bookmarkstoolbar.cpp
+++ b/src/bookmarks/bookmarkstoolbar.cpp
@@ -233,17 +233,16 @@ bool BookmarkToolBar::eventFilter(QObject *watched, QEvent *event)
&& !m_currentMenu->rect().contains(m_currentMenu->mapFromGlobal(QCursor::pos())))
{
// To switch root folders as in a menubar
- if (event->type() == QEvent::MouseMove)
+
+ KBookmarkActionMenu* act = dynamic_cast<KBookmarkActionMenu *>(toolBar()->actionAt(toolBar()->mapFromGlobal(QCursor::pos())));
+
+ if (event->type() == QEvent::MouseMove && act && act->menu() != m_currentMenu)
{
- KBookmarkActionMenu* act = dynamic_cast<KBookmarkActionMenu *>(toolBar()->actionAt(toolBar()->mapFromGlobal(QCursor::pos())));
- if (act && act->menu() != m_currentMenu)
- {
m_currentMenu->hide();
QPoint pos = toolBar()->mapToGlobal(toolBar()->widgetForAction(act)->pos());
act->menu()->popup(QPoint(pos.x(), pos.y() + toolBar()->widgetForAction(act)->height()));
- }
}
- else if (event->type() == QEvent::MouseButtonPress)
+ else if (event->type() == QEvent::MouseButtonPress && act)
{
m_currentMenu->hide();
}