From 1765cacc60d101bb8dddbe990bd729f8cdb5087f Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sun, 6 May 2018 14:02:18 +0200 Subject: New window action --- src/mainwindow/mainwindow.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mainwindow') diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index 5129abc..88a0b42 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -28,6 +28,7 @@ #include #include #include +#include "browser.h" MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) : QMainWindow(parent) @@ -113,9 +114,13 @@ void MainWindow::createMenuBar() auto *smolboteMenu = menuBar()->addMenu(qApp->applicationDisplayName()); smolboteMenu->addAction(tr("New tab group"), this, [this]() { createSubWindow(); - }, - QKeySequence(m_config->value("mainwindow.shortcuts.newGroup").value().c_str())); - smolboteMenu->addAction(tr("New window"))->setEnabled(false); + }, QKeySequence(m_config->value("mainwindow.shortcuts.newGroup").value().c_str())); + + smolboteMenu->addAction(tr("New window"), this, [this]() { + auto *browser = qobject_cast(qApp); + if(browser) + browser->createWindow(); + }, QKeySequence(m_config->value("mainwindow.shortcuts.newWindow").value().c_str())); smolboteMenu->addSeparator(); -- cgit v1.2.1