Qt: Add keyboard shortcut to exit fullscreen (fixes #205)
Jeffrey Pfau jeffrey@endrift.com
Tue, 24 Mar 2015 22:54:13 -0700
2 files changed,
11 insertions(+),
0 deletions(-)
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -374,6 +374,14 @@ event->accept();
m_controller->loadGame(url.path()); } +void Window::exitFullScreen() { + if (!isFullScreen()) { + return; + } + showNormal(); + menuBar()->show(); +} + void Window::toggleFullScreen() { if (isFullScreen()) { showNormal();@@ -816,6 +824,8 @@ m_controller->setTurbo(true, false);
}, [this]() { m_controller->setTurbo(false, false); }, QKeySequence(Qt::Key_Tab), tr("Fast Forward (held)"), "holdFastForward"); + + addControlledAction(other, other->addAction(tr("Exit fullscreen"), this, SLOT(exitFullScreen()), QKeySequence("Esc")), "exitFullscreen"); foreach (QAction* action, m_gameActions) { action->setDisabled(true);
M
src/platform/qt/Window.h
→
src/platform/qt/Window.h
@@ -59,6 +59,7 @@ public slots:
void selectROM(); void selectBIOS(); void selectPatch(); + void exitFullScreen(); void toggleFullScreen(); void loadConfig(); void saveConfig();