all repos — mgba @ 9d80089194c43a509ebc68270d131c6a0f2d2265

mGBA Game Boy Advance Emulator

Qt: Add keyboard shortcut to exit fullscreen (fixes #205)
Jeffrey Pfau jeffrey@endrift.com
Tue, 24 Mar 2015 22:54:13 -0700
commit

9d80089194c43a509ebc68270d131c6a0f2d2265

parent

b6ddf8fd0081a9dc9b5b491f4ef573faf0779cad

2 files changed, 11 insertions(+), 0 deletions(-)

jump to
M src/platform/qt/Window.cppsrc/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.hsrc/platform/qt/Window.h

@@ -59,6 +59,7 @@ public slots:

void selectROM(); void selectBIOS(); void selectPatch(); + void exitFullScreen(); void toggleFullScreen(); void loadConfig(); void saveConfig();