mirror of https://github.com/mgba-emu/mgba.git
Qt: Move exit fullscreen to the frame size menu
This commit is contained in:
parent
74af12317c
commit
1b74517e8b
|
@ -1016,10 +1016,10 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
m_inputController.setAllowOpposing(value.toBool());
|
m_inputController.setAllowOpposing(value.toBool());
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
QMenu* other = new QMenu(tr("Other"), this);
|
QAction* exitFullScreen = new QAction(tr("Exit fullscreen"), frameMenu);
|
||||||
m_shortcutController->addMenu(other);
|
connect(exitFullScreen, SIGNAL(triggered()), this, SLOT(exitFullScreen()));
|
||||||
|
exitFullScreen->setShortcut(QKeySequence("Esc"));
|
||||||
addControlledAction(other, other->addAction(tr("Exit fullscreen"), this, SLOT(exitFullScreen()), QKeySequence("Esc")), "exitFullScreen");
|
addHiddenAction(frameMenu, exitFullScreen, "exitFullScreen");
|
||||||
|
|
||||||
foreach (QAction* action, m_gameActions) {
|
foreach (QAction* action, m_gameActions) {
|
||||||
action->setDisabled(true);
|
action->setDisabled(true);
|
||||||
|
@ -1066,8 +1066,13 @@ void Window::updateMRU() {
|
||||||
}
|
}
|
||||||
|
|
||||||
QAction* Window::addControlledAction(QMenu* menu, QAction* action, const QString& name) {
|
QAction* Window::addControlledAction(QMenu* menu, QAction* action, const QString& name) {
|
||||||
m_shortcutController->addAction(menu, action, name);
|
addHiddenAction(menu, action, name);
|
||||||
menu->addAction(action);
|
menu->addAction(action);
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
QAction* Window::addHiddenAction(QMenu* menu, QAction* action, const QString& name) {
|
||||||
|
m_shortcutController->addAction(menu, action, name);
|
||||||
action->setShortcutContext(Qt::WidgetShortcut);
|
action->setShortcutContext(Qt::WidgetShortcut);
|
||||||
addAction(action);
|
addAction(action);
|
||||||
return action;
|
return action;
|
||||||
|
|
|
@ -131,6 +131,7 @@ private:
|
||||||
void openView(QWidget* widget);
|
void openView(QWidget* widget);
|
||||||
|
|
||||||
QAction* addControlledAction(QMenu* menu, QAction* action, const QString& name);
|
QAction* addControlledAction(QMenu* menu, QAction* action, const QString& name);
|
||||||
|
QAction* addHiddenAction(QMenu* menu, QAction* action, const QString& name);
|
||||||
|
|
||||||
GameController* m_controller;
|
GameController* m_controller;
|
||||||
Display* m_display;
|
Display* m_display;
|
||||||
|
|
Loading…
Reference in New Issue