Commit f181265f authored by Joshua Goins's avatar Joshua Goins Committed by Albert Astals Cid
Browse files

Add fullscreen toggle

BUG: 255316
parent f0bc9d7c
Pipeline #161664 passed with stage
in 2 minutes and 47 seconds
......@@ -22,6 +22,8 @@
#include <QLabel>
#include <QPointer>
#include <QStatusBar>
#include <KToggleFullScreenAction>
#include <QMenuBar>
#define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
#include <libkdegamesprivate/kgamethemeselector.h>
......@@ -35,6 +37,9 @@ KapmanMainWindow::KapmanMainWindow()
KStandardGameAction::gameNew(this, &KapmanMainWindow::newGame, actionCollection());
KStandardGameAction::highscores(this, &KapmanMainWindow::showHighscores, actionCollection());
KStandardAction::preferences(this, &KapmanMainWindow::showSettings, actionCollection());
KStandardAction::fullScreen(this, &KapmanMainWindow::viewFullScreen, this, actionCollection());
KStandardGameAction::quit(this, &KapmanMainWindow::close, actionCollection());
auto soundAction = new KToggleAction(i18n("&Play Sounds"), this);
soundAction->setChecked(Settings::sounds());
......@@ -62,6 +67,9 @@ KapmanMainWindow::KapmanMainWindow()
// Setup the window
setupGUI();
menuBar()->setVisible(!isFullScreen());
statusBar()->setVisible(!isFullScreen());
initGame();
}
......@@ -233,3 +241,11 @@ void KapmanMainWindow::resetStatusBar()
displayScore(0);
displayLives(initLives);
}
void KapmanMainWindow::viewFullScreen(bool fullScreen)
{
KToggleFullScreenAction::setFullScreen(this, fullScreen);
menuBar()->setVisible(!fullScreen);
statusBar()->setVisible(!fullScreen);
}
......@@ -117,6 +117,8 @@ private Q_SLOTS:
* Resets the status bar values altogether for convenience.
*/
void resetStatusBar();
void viewFullScreen(bool fullScreen);
};
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment