aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
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));