diff options
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/bookmarkstoolbar.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp index 55710ca..b8747d8 100644 --- a/src/bookmarks/bookmarkstoolbar.cpp +++ b/src/bookmarks/bookmarkstoolbar.cpp @@ -15,6 +15,9 @@ BookmarksToolbar::BookmarksToolbar(const BookmarkModel *model, MainWindow *paren : QToolBar(parent) { m_window = parent; + setObjectName("bookmarkstoolbar"); + setWindowTitle(tr("Bookmarks Toolbar")); + setMovable(false); setToolButtonStyle(Qt::ToolButtonTextBesideIcon); const auto *root = model->root(); @@ -58,6 +61,12 @@ void BookmarksToolbar::addFolder(const BookmarkItem *item, QMenu *where) auto *menu = new QMenu(this); addFolder(child, menu); action->setMenu(menu); + + connect(action, &QAction::triggered, this, [this, action, menu]() { + const auto *widget = this->widgetForAction(action); + const auto pos = widget->mapToGlobal(QPoint(0, widget->height())); + menu->popup(pos); + }); } } } |