diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-29 15:47:29 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-29 15:47:29 +0200 |
commit | cccdc668d25444277d39b040c0220505cf52f5b3 (patch) | |
tree | 26fb4e5a604d13b4774fecf486c914f312d2ca50 /src/bookmarks | |
parent | BookmarksToolbar: show text next to icon (diff) | |
download | smolbote-cccdc668d25444277d39b040c0220505cf52f5b3.tar.xz |
BookmarksToolbar: add toggle shortcut
- MenuBar: add toggles for MainWindow toolbars to Window menu
- set NavigationBar and BookmarksToolbar titles so the default
MainWindow context menu makes sense
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); + }); } } } |