diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-06 15:40:25 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-10-06 15:40:25 +0200 |
commit | 3e6bed362176dfa53dbaa082e2b0be45bd7cf087 (patch) | |
tree | dd1c5b742566d56e8d9190d4f60d82d0cffec7c4 /src | |
parent | bookmarks: save folder expanded state (diff) | |
download | smolbote-3e6bed362176dfa53dbaa082e2b0be45bd7cf087.tar.xz |
Add "subwindow.shortcuts.menu" shortcut
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow/mainwindow.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index b3a7722..cabc94b 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -183,6 +183,19 @@ MainWindow::MainWindow(const std::unique_ptr<Configuration> &config, QWidget *pa connect(pageLoadProfileMenu, &QMenu::aboutToShow, this, &MainWindow::updatePageLoadProfileMenu); } + // current subwindow shortcut + { + QAction *subwindowMenuAction = new QAction(this); + QMainWindow::addAction(subwindowMenuAction); + config->setShortcut(subwindowMenuAction, "subwindow.shortcuts.menu"); + connect(subwindowMenuAction, &QAction::triggered, this, [this]() { + QMdiSubWindow *window = mdiArea->currentSubWindow(); + if(window) { + window->systemMenu()->exec(); + } + }); + } + navigationToolBar = new NavigationBar(config->section("navigation"), this); navigationToolBar->setMovable(config->value<bool>("navigation.movable").value()); addToolBar(Qt::TopToolBarArea, navigationToolBar); @@ -313,11 +326,7 @@ void MainWindow::removeDockWidget(QWidget *widget) void MainWindow::createTab(const QUrl &url) { auto *w = qobject_cast<SubWindow *>(mdiArea->currentSubWindow()); - if(w == nullptr) { - //w = createSubWindow(url.toString()); - // w = createSubWindow(WebProfile::defaultProfile()); - // w->addTab(url); - } else { + if(w != nullptr) { w->addTab(url); } } |