mirror of https://github.com/mgba-emu/mgba.git
Qt: Add keyboard shortcut to exit fullscreen (fixes #205)
This commit is contained in:
parent
b6ddf8fd00
commit
9d80089194
|
@ -374,6 +374,14 @@ void Window::dropEvent(QDropEvent* event) {
|
||||||
m_controller->loadGame(url.path());
|
m_controller->loadGame(url.path());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Window::exitFullScreen() {
|
||||||
|
if (!isFullScreen()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showNormal();
|
||||||
|
menuBar()->show();
|
||||||
|
}
|
||||||
|
|
||||||
void Window::toggleFullScreen() {
|
void Window::toggleFullScreen() {
|
||||||
if (isFullScreen()) {
|
if (isFullScreen()) {
|
||||||
showNormal();
|
showNormal();
|
||||||
|
@ -817,6 +825,8 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
m_controller->setTurbo(false, false);
|
m_controller->setTurbo(false, false);
|
||||||
}, QKeySequence(Qt::Key_Tab), tr("Fast Forward (held)"), "holdFastForward");
|
}, 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) {
|
foreach (QAction* action, m_gameActions) {
|
||||||
action->setDisabled(true);
|
action->setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ public slots:
|
||||||
void selectROM();
|
void selectROM();
|
||||||
void selectBIOS();
|
void selectBIOS();
|
||||||
void selectPatch();
|
void selectPatch();
|
||||||
|
void exitFullScreen();
|
||||||
void toggleFullScreen();
|
void toggleFullScreen();
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
void saveConfig();
|
void saveConfig();
|
||||||
|
|
Loading…
Reference in New Issue