From 892daad6789d440f60521197ae0a3f47def59256 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 19 Apr 2018 13:21:48 +0200 Subject: Add Window menu - add new tab button to tab widget - tab shortcuts are read from configuration again - updated manpage some --- src/mainwindow/mainwindow.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mainwindow/mainwindow.cpp') diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index 0052d13..23bc7da 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -66,6 +66,7 @@ MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) disconnect(navigationBarConnection); disconnect(searchBoxConnection); disconnect(statusBarConnection); + windowMenu->setMenu(nullptr); auto *w = qobject_cast(window); if(w == nullptr) { @@ -75,6 +76,7 @@ MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) navigationToolBar->connectWebView(nullptr); searchBox->setView(nullptr); } else { + windowMenu->setMenu(w->systemMenu()); addressBar->connectWebView(w->currentView()); addressBarConnection = connect(w, &Window::currentViewChanged, addressBar, &AddressBar::connectWebView); navigationToolBar->connectWebView(w->currentView()); @@ -107,11 +109,6 @@ MainWindow::~MainWindow() void MainWindow::createMenuBar() { auto *smolboteMenu = menuBar()->addMenu(qApp->applicationDisplayName()); - smolboteMenu->addAction(tr("New tab"), this, [this]() { - createTab(QUrl::fromUserInput("about:blank")); - }, - QKeySequence(m_config->value("mainwindow.shortcuts.newTab").value().c_str())); - smolboteMenu->addAction(tr("New tab group"), this, [this]() { createSubWindow(QUrl::fromUserInput("about:blank")); }, @@ -132,6 +129,7 @@ void MainWindow::createMenuBar() smolboteMenu->addAction(tr("Quit"), qApp, &QApplication::quit, QKeySequence(m_config->value("mainwindow.shortcuts.quit").value().c_str())); + windowMenu = menuBar()->addAction(tr("Window")); toolsMenu = menuBar()->addMenu(tr("Tools")); } @@ -174,7 +172,7 @@ void MainWindow::createTab(const QUrl &url) Window *MainWindow::createSubWindow(const QUrl &url) { - auto *w = new Window(this); + auto *w = new Window(m_config->section("window"), this); mdiArea->addSubWindow(w); w->showMaximized(); w->setFocus(); -- cgit v1.2.1