all repos — mgba @ 1b74517e8bbf7507162d46adcf55256b4068a8ec

mGBA Game Boy Advance Emulator

Qt: Move exit fullscreen to the frame size menu
Jeffrey Pfau jeffrey@endrift.com
Sun, 03 May 2015 03:33:19 -0700
commit

1b74517e8bbf7507162d46adcf55256b4068a8ec

parent

74af12317c18d20781a83886ecc33238f37238f9

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

jump to
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -1016,10 +1016,10 @@ allowOpposingDirections->connect([this](const QVariant& value) {

m_inputController.setAllowOpposing(value.toBool()); }, this); - QMenu* other = new QMenu(tr("Other"), this); - m_shortcutController->addMenu(other); - - addControlledAction(other, other->addAction(tr("Exit fullscreen"), this, SLOT(exitFullScreen()), QKeySequence("Esc")), "exitFullScreen"); + QAction* exitFullScreen = new QAction(tr("Exit fullscreen"), frameMenu); + connect(exitFullScreen, SIGNAL(triggered()), this, SLOT(exitFullScreen())); + exitFullScreen->setShortcut(QKeySequence("Esc")); + addHiddenAction(frameMenu, exitFullScreen, "exitFullScreen"); foreach (QAction* action, m_gameActions) { action->setDisabled(true);

@@ -1066,8 +1066,13 @@ m_mruMenu->setEnabled(i > 0);

} QAction* Window::addControlledAction(QMenu* menu, QAction* action, const QString& name) { + addHiddenAction(menu, action, name); + menu->addAction(action); + return action; +} + +QAction* Window::addHiddenAction(QMenu* menu, QAction* action, const QString& name) { m_shortcutController->addAction(menu, action, name); - menu->addAction(action); action->setShortcutContext(Qt::WidgetShortcut); addAction(action); return action;
M src/platform/qt/Window.hsrc/platform/qt/Window.h

@@ -131,6 +131,7 @@

void openView(QWidget* widget); QAction* addControlledAction(QMenu* menu, QAction* action, const QString& name); + QAction* addHiddenAction(QMenu* menu, QAction* action, const QString& name); GameController* m_controller; Display* m_display;