all repos — mgba @ 1ee69deffb8f95a6fd5923dfcc6ade99f4b41b9a

mGBA Game Boy Advance Emulator

Qt: Fix issue with set frame sizes being the wrong height
Jeffrey Pfau jeffrey@endrift.com
Tue, 16 Dec 2014 00:21:29 -0800
commit

1ee69deffb8f95a6fd5923dfcc6ade99f4b41b9a

parent

fcac245b989875ea59342c2f71bd06135329576f

3 files changed, 16 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -1,5 +1,8 @@

0.2.0: (Future) +Features: - Support for gamepad axes, e.g. analog sticks or triggers +Bugfixes: + - Qt: Fix issue with set frame sizes being the wrong height 0.1.0: (2014-12-13) - Initial release
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -114,6 +114,13 @@ m_controller->loadGame(args->fname, args->dirmode);

} } +void Window::resizeFrame(int width, int height) { + QSize newSize(width, height); + newSize -= m_screenWidget->size(); + newSize += size(); + resize(newSize); +} + void Window::setConfig(ConfigController* config) { m_config = config; }

@@ -479,25 +486,25 @@ QMenu* frameMenu = avMenu->addMenu(tr("Frame size"));

QAction* setSize = new QAction(tr("1x"), avMenu); connect(setSize, &QAction::triggered, [this]() { showNormal(); - resize(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS); + resizeFrame(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS); }); frameMenu->addAction(setSize); setSize = new QAction(tr("2x"), avMenu); connect(setSize, &QAction::triggered, [this]() { showNormal(); - resize(VIDEO_HORIZONTAL_PIXELS * 2, VIDEO_VERTICAL_PIXELS * 2); + resizeFrame(VIDEO_HORIZONTAL_PIXELS * 2, VIDEO_VERTICAL_PIXELS * 2); }); frameMenu->addAction(setSize); setSize = new QAction(tr("3x"), avMenu); connect(setSize, &QAction::triggered, [this]() { showNormal(); - resize(VIDEO_HORIZONTAL_PIXELS * 3, VIDEO_VERTICAL_PIXELS * 3); + resizeFrame(VIDEO_HORIZONTAL_PIXELS * 3, VIDEO_VERTICAL_PIXELS * 3); }); frameMenu->addAction(setSize); setSize = new QAction(tr("4x"), avMenu); connect(setSize, &QAction::triggered, [this]() { showNormal(); - resize(VIDEO_HORIZONTAL_PIXELS * 4, VIDEO_VERTICAL_PIXELS * 4); + resizeFrame(VIDEO_HORIZONTAL_PIXELS * 4, VIDEO_VERTICAL_PIXELS * 4); }); frameMenu->addAction(setSize); addAction(frameMenu->addAction(tr("Fullscreen"), this, SLOT(toggleFullScreen()), QKeySequence("Ctrl+F")));
M src/platform/qt/Window.hsrc/platform/qt/Window.h

@@ -44,6 +44,8 @@

void setConfig(ConfigController*); void argumentsPassed(GBAArguments*); + void resizeFrame(int width, int height); + signals: void startDrawing(const uint32_t*, GBAThread*); void shutdown();