all repos — mgba @ 08fee36c208ecfb8c8298b7ea76d036e4550a769

mGBA Game Boy Advance Emulator

Window resizing options
Jeffrey Pfau jeffrey@endrift.com
Tue, 22 Jul 2014 03:26:16 -0700
commit

08fee36c208ecfb8c8298b7ea76d036e4550a769

parent

d020bf4f0a4532f21c3573fcab75e4a7b3f658f1

1 files changed, 28 insertions(+), 0 deletions(-)

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

@@ -191,6 +191,34 @@ setTarget = new QAction(tr("240"), nullptr);

connect(setTarget, &QAction::triggered, [this]() { emit fpsTargetChanged(240); }); target->addAction(setTarget); + QMenu* videoMenu = menubar->addMenu(tr("&Video")); + QMenu* frameMenu = videoMenu->addMenu(tr("Frame &size")); + QAction* setSize = new QAction(tr("1x"), nullptr); + connect(setSize, &QAction::triggered, [this]() { + showNormal(); + resize(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS); + }); + frameMenu->addAction(setSize); + setSize = new QAction(tr("2x"), nullptr); + connect(setSize, &QAction::triggered, [this]() { + showNormal(); + resize(VIDEO_HORIZONTAL_PIXELS * 2, VIDEO_VERTICAL_PIXELS * 2); + }); + frameMenu->addAction(setSize); + setSize = new QAction(tr("3x"), nullptr); + connect(setSize, &QAction::triggered, [this]() { + showNormal(); + resize(VIDEO_HORIZONTAL_PIXELS * 3, VIDEO_VERTICAL_PIXELS * 3); + }); + frameMenu->addAction(setSize); + setSize = new QAction(tr("4x"), nullptr); + connect(setSize, &QAction::triggered, [this]() { + showNormal(); + resize(VIDEO_HORIZONTAL_PIXELS * 4, VIDEO_VERTICAL_PIXELS * 4); + }); + frameMenu->addAction(setSize); + frameMenu->addAction(tr("Fullscreen"), this, SLOT(showFullScreen()), QKeySequence("Ctrl+F")); + QMenu* soundMenu = menubar->addMenu(tr("&Sound")); QMenu* buffersMenu = soundMenu->addMenu(tr("Buffer &size")); QAction* setBuffer = new QAction(tr("512"), nullptr);