all repos — mgba @ 3dc22d9cc5c93429dabd8428bfc359132543f318

mGBA Game Boy Advance Emulator

Qt: Ensure frame size options stay checked
Jeffrey Pfau jeffrey@endrift.com
Fri, 07 Aug 2015 20:26:19 -0700
commit

3dc22d9cc5c93429dabd8428bfc359132543f318

parent

c39be359df21c462b110ab049608c6e7e1e5aef8

1 files changed, 4 insertions(+), 1 deletions(-)

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

@@ -939,9 +939,12 @@ m_shortcutController->addMenu(frameMenu, avMenu);

for (int i = 1; i <= 6; ++i) { QAction* setSize = new QAction(tr("%1x").arg(QString::number(i)), avMenu); setSize->setCheckable(true); - connect(setSize, &QAction::triggered, [this, i]() { + connect(setSize, &QAction::triggered, [this, i, setSize]() { showNormal(); resizeFrame(VIDEO_HORIZONTAL_PIXELS * i, VIDEO_VERTICAL_PIXELS * i); + bool enableSignals = setSize->blockSignals(true); + setSize->setChecked(true); + setSize->blockSignals(enableSignals); }); m_frameSizes[i] = setSize; addControlledAction(frameMenu, setSize, QString("frame%1x").arg(QString::number(i)));