all repos — mgba @ 8ee83873608d34e35445c0c63f273fa1b05d271d

mGBA Game Boy Advance Emulator

Qt: Fix issue with set frame sizes being the wrong height

Conflicts:
	CHANGES
Jeffrey Pfau jeffrey@endrift.com
Tue, 16 Dec 2014 00:21:29 -0800
commit

8ee83873608d34e35445c0c63f273fa1b05d271d

parent

90e66d0cd682fe2ed008ef454602f06d8871d79b

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

jump to
M CHANGESCHANGES

@@ -1,2 +1,6 @@

+0.1.1: (Future) +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();