Skip to content

Commit

Permalink
feat: add a fullscreen shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia committed May 19, 2020
1 parent 1864ff5 commit fe0b36d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ MainWindow::MainWindow(QWidget *parent) :
connect(nextPictureShorucut, &QShortcut::activated,
this, &MainWindow::galleryNext);

QShortcut * fullscreenShorucut = new QShortcut(QKeySequence(QKeySequence::FullScreen), this);
connect(fullscreenShorucut, &QShortcut::activated,
this, &MainWindow::toggleFullscreen);

centerWindow();
}

Expand Down Expand Up @@ -561,3 +565,12 @@ void MainWindow::quitAppAction(bool force)
closeWindow();
}
}

void MainWindow::toggleFullscreen()
{
if (isFullScreen()) {
showNormal();
} else {
showFullScreen();
}
}
1 change: 1 addition & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected slots:
void toggleStayOnTop();
bool stayOnTop();
void quitAppAction(bool force = false);
void toggleFullscreen();

private:
QPoint m_oldMousePos;
Expand Down

0 comments on commit fe0b36d

Please sign in to comment.