aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2017-05-25 08:11:45 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2017-05-25 08:11:45 +0200
commitec102d766a4a36cc661567e80fa7bd78296d9ec1 (patch)
treee5b18834881198a032bd99aff58f2c030a661c79 /src/mainwindow.cpp
parentImproved filter rules (diff)
downloadsmolbote-ec102d766a4a36cc661567e80fa7bd78296d9ec1.tar.xz
Added fullscreen toggle
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp13
1 files changed, 13 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));