feat: add a fullscreen shortcut
This commit is contained in:
parent
1864ff5b7f
commit
fe0b36dc34
@ -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();
|
||||
}
|
||||
|
||||
@ -561,3 +565,12 @@ void MainWindow::quitAppAction(bool force)
|
||||
closeWindow();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::toggleFullscreen()
|
||||
{
|
||||
if (isFullScreen()) {
|
||||
showNormal();
|
||||
} else {
|
||||
showFullScreen();
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ protected slots:
|
||||
void toggleStayOnTop();
|
||||
bool stayOnTop();
|
||||
void quitAppAction(bool force = false);
|
||||
void toggleFullscreen();
|
||||
|
||||
private:
|
||||
QPoint m_oldMousePos;
|
||||
|
Loading…
Reference in New Issue
Block a user