diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-05-25 08:11:45 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-05-25 08:11:45 +0200 |
commit | ec102d766a4a36cc661567e80fa7bd78296d9ec1 (patch) | |
tree | e5b18834881198a032bd99aff58f2c030a661c79 /src | |
parent | Improved filter rules (diff) | |
download | smolbote-ec102d766a4a36cc661567e80fa7bd78296d9ec1.tar.xz |
Added fullscreen toggle
Diffstat (limited to 'src')
-rw-r--r-- | src/mainwindow.cpp | 13 | ||||
-rw-r--r-- | src/mainwindow.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 587b072..537c04f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -43,6 +43,10 @@ MainWindow::MainWindow(QUrl defaultUrl, QWidget *parent) : { // set up UI ui->setupUi(this); + QAction *fullscreenAction = new QAction(this); + fullscreenAction->setShortcut(QKeySequence::fromString(sSettings->value("window.shortcuts.fullscreen").toString())); + connect(fullscreenAction, SIGNAL(triggered(bool)), this, SLOT(toggleFullscreen())); + addAction(fullscreenAction); // Dockable widget styling setDockOptions(dockOptions() | AllowTabbedDocks | ForceTabbedDocks); @@ -222,6 +226,15 @@ void MainWindow::loadProfile(const QString name) tabBar->setProfile(m_profile); } +void MainWindow::toggleFullscreen() +{ + if(isFullScreen()) { + setWindowState(Qt::WindowMaximized | Qt::WindowActive); + } else { + setWindowState(Qt::WindowFullScreen | Qt::WindowActive); + } +} + void MainWindow::handleNewWindow(const QUrl &url) { Browser::instance()->addWindow(new MainWindow(url)); diff --git a/src/mainwindow.h b/src/mainwindow.h index a2f365c..059da02 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -53,6 +53,8 @@ public slots: void loadProfile(const QString name = ""); + void toggleFullscreen(); + protected: void closeEvent(QCloseEvent *event) override; |