diff --git a/CHANGES b/CHANGES index 7c91d8b78..8dcab16db 100644 --- a/CHANGES +++ b/CHANGES @@ -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 diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 25ee23ca2..7a56d3d0e 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -114,6 +114,13 @@ void Window::argumentsPassed(GBAArguments* args) { } } +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 @@ void Window::setupMenu(QMenuBar* menubar) { 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"))); diff --git a/src/platform/qt/Window.h b/src/platform/qt/Window.h index 780743298..1e99d41d9 100644 --- a/src/platform/qt/Window.h +++ b/src/platform/qt/Window.h @@ -44,6 +44,8 @@ public: void setConfig(ConfigController*); void argumentsPassed(GBAArguments*); + void resizeFrame(int width, int height); + signals: void startDrawing(const uint32_t*, GBAThread*); void shutdown();