Qt: Fix issue with set frame sizes being the wrong height
Jeffrey Pfau jeffrey@endrift.com
Tue, 16 Dec 2014 00:21:29 -0800
3 files changed,
16 insertions(+),
4 deletions(-)
M
src/platform/qt/Window.cpp
→
src/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.h
→
src/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();