diff options
Diffstat (limited to 'src/mainwindow')
-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); } } |