aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/configuration/configuration.cpp3
-rw-r--r--src/mainwindow/mainwindow.cpp19
2 files changed, 16 insertions, 6 deletions
diff --git a/lib/configuration/configuration.cpp b/lib/configuration/configuration.cpp
index 1edd9ed..0898c09 100644
--- a/lib/configuration/configuration.cpp
+++ b/lib/configuration/configuration.cpp
@@ -65,7 +65,7 @@ Configuration::Configuration(QObject *parent)
("mainwindow.shortcuts.newGroup", po::value<std::string>()->default_value("Ctrl+G"))
("mainwindow.shortcuts.newWindow", po::value<std::string>()->default_value("Ctrl+N"))
- ("mainwindow.shortcuts.about", po::value<std::string>()->default_value("F1"))
+ ("mainwindow.shortcuts.about", po::value<std::string>()->default_value("Ctrl+H"))
("mainwindow.shortcuts.quit", po::value<std::string>()->default_value("Ctrl+Q"))
("mainwindow.shortcuts.search", po::value<std::string>()->default_value("F3"))
@@ -87,6 +87,7 @@ Configuration::Configuration(QObject *parent)
("addressbar.shortcuts.menu", po::value<std::string>()->default_value("F2"))
// subwindow
+ ("subwindow.shortcuts.menu", po::value<std::string>()->default_value("F1"))
("subwindow.shortcuts.new", po::value<std::string>()->default_value("Ctrl+T"))
("subwindow.shortcuts.close", po::value<std::string>()->default_value("Ctrl+X"))
("subwindow.shortcuts.left", po::value<std::string>()->default_value("Ctrl+O"))
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);
}
}