diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-19 13:21:48 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-19 13:21:48 +0200 |
commit | 892daad6789d440f60521197ae0a3f47def59256 (patch) | |
tree | dfc32d336b75a5524605f7392e4256db960dfe1b /src/mainwindow/mainwindow.cpp | |
parent | Removed MainWindow::titleChangedConnection (diff) | |
download | smolbote-892daad6789d440f60521197ae0a3f47def59256.tar.xz |
Add Window menu
- add new tab button to tab widget
- tab shortcuts are read from configuration again
- updated manpage some
Diffstat (limited to 'src/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/mainwindow/mainwindow.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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<Configuration> &config, QWidget *parent) disconnect(navigationBarConnection); disconnect(searchBoxConnection); disconnect(statusBarConnection); + windowMenu->setMenu(nullptr); auto *w = qobject_cast<Window *>(window); if(w == nullptr) { @@ -75,6 +76,7 @@ MainWindow::MainWindow(std::shared_ptr<Configuration> &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<std::string>("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<std::string>("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(); |