aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow/mainwindow.cpp')
-rw-r--r--src/mainwindow/mainwindow.cpp10
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();