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