From 65a8a4e76be5cb06255faf99432de1145ade396d Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 16 Dec 2014 22:23:58 -0800 Subject: [PATCH] Qt: Add scale presets for up to 6x --- CHANGES | 1 + src/platform/qt/Window.cpp | 32 ++++++++------------------------ 2 files changed, 9 insertions(+), 24 deletions(-) diff --git a/CHANGES b/CHANGES index 60b552cda..4f546846d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 0.2.0: (Future) Features: - Support for gamepad axes, e.g. analog sticks or triggers + - Add scale presets for up to 6x Bugfixes: - Qt: Fix issue with set frame sizes being the wrong height - Qt: Fix emulator crashing when full screen if a game is not running diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 18a2e5674..f5b8b83a8 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -490,30 +490,14 @@ void Window::setupMenu(QMenuBar* menubar) { QMenu* avMenu = menubar->addMenu(tr("Audio/&Video")); QMenu* frameMenu = avMenu->addMenu(tr("Frame size")); - QAction* setSize = new QAction(tr("1x"), avMenu); - connect(setSize, &QAction::triggered, [this]() { - showNormal(); - resizeFrame(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS); - }); - frameMenu->addAction(setSize); - setSize = new QAction(tr("2x"), avMenu); - connect(setSize, &QAction::triggered, [this]() { - showNormal(); - resizeFrame(VIDEO_HORIZONTAL_PIXELS * 2, VIDEO_VERTICAL_PIXELS * 2); - }); - frameMenu->addAction(setSize); - setSize = new QAction(tr("3x"), avMenu); - connect(setSize, &QAction::triggered, [this]() { - showNormal(); - resizeFrame(VIDEO_HORIZONTAL_PIXELS * 3, VIDEO_VERTICAL_PIXELS * 3); - }); - frameMenu->addAction(setSize); - setSize = new QAction(tr("4x"), avMenu); - connect(setSize, &QAction::triggered, [this]() { - showNormal(); - resizeFrame(VIDEO_HORIZONTAL_PIXELS * 4, VIDEO_VERTICAL_PIXELS * 4); - }); - frameMenu->addAction(setSize); + for (int i = 1; i <= 6; ++i) { + QAction* setSize = new QAction(tr("%1x").arg(QString::number(i)), avMenu); + connect(setSize, &QAction::triggered, [this, i]() { + showNormal(); + resizeFrame(VIDEO_HORIZONTAL_PIXELS * i, VIDEO_VERTICAL_PIXELS * i); + }); + frameMenu->addAction(setSize); + } addAction(frameMenu->addAction(tr("Fullscreen"), this, SLOT(toggleFullScreen()), QKeySequence("Ctrl+F"))); ConfigOption* lockAspectRatio = m_config->addOption("lockAspectRatio");