all repos — mgba @ 0b2f8bb4dcf74ffc0bd28c7349e73450aea4010d

mGBA Game Boy Advance Emulator

Qt: Manage window sizes slightly better
Jeffrey Pfau jeffrey@endrift.com
Tue, 04 Oct 2016 10:36:31 -0700
commit

0b2f8bb4dcf74ffc0bd28c7349e73450aea4010d

parent

0a791a2f7d20ba53f0b66afb671581805334c463

M CHANGESCHANGES

@@ -36,6 +36,7 @@ - SDL: Remove scancode key input

- GB Video: Improved video timings - All: Split out install locations for Libretro and OpenEmu - GBA Video: Clean up unused timers + - Qt: Manage window sizes slightly better 0.5.0: (2016-09-19) Features:
M src/platform/qt/ConfigController.cppsrc/platform/qt/ConfigController.cpp

@@ -114,6 +114,7 @@ m_opts.rewindEnable = false;

m_opts.rewindBufferCapacity = 300; m_opts.useBios = true; m_opts.suspendScreensaver = true; + m_opts.lockAspectRatio = true; mCoreConfigLoad(&m_config); mCoreConfigLoadDefaults(&m_config, &m_opts); mCoreConfigMap(&m_config, &m_opts);
M src/platform/qt/Display.cppsrc/platform/qt/Display.cpp

@@ -9,7 +9,11 @@ #include "DisplayGL.h"

#include "DisplayQt.h" extern "C" { +#ifdef M_CORE_GB #include "gb/video.h" +#elif defined(M_CORE_GBA) +#include "gba/video.h" +#endif } using namespace QGBA;

@@ -55,7 +59,11 @@ , m_lockAspectRatio(false)

, m_filter(false) { setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); +#ifdef M_CORE_GB setMinimumSize(GB_VIDEO_HORIZONTAL_PIXELS, GB_VIDEO_VERTICAL_PIXELS); +#elif defined(M_CORE_GBA) + setMinimumSize(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS); +#endif connect(&m_mouseTimer, SIGNAL(timeout()), this, SIGNAL(hideCursor())); m_mouseTimer.setSingleShot(true); m_mouseTimer.setInterval(MOUSE_DISAPPEAR_TIMER);
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -89,7 +89,9 @@ m_logo = m_logo; // Free memory left over in old pixmap

m_screenWidget->setMinimumSize(m_display->minimumSize()); m_screenWidget->setSizePolicy(m_display->sizePolicy()); - m_screenWidget->setSizeHint(m_display->minimumSize() * 2); +#ifdef M_CORE_GBA + m_screenWidget->setSizeHint(QSize(VIDEO_HORIZONTAL_PIXELS * 2, VIDEO_VERTICAL_PIXELS * 2)); +#endif m_screenWidget->setPixmap(m_logo); m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height()); setCentralWidget(m_screenWidget);

@@ -705,6 +707,7 @@ updateTitle();

unsigned width, height; context->core->desiredVideoDimensions(context->core, &width, &height); m_display->setMinimumSize(width, height); + m_screenWidget->setMinimumSize(m_display->minimumSize()); attachWidget(m_display); #ifndef Q_OS_MAC

@@ -733,6 +736,12 @@ detachWidget(m_display);

m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height()); m_screenWidget->setPixmap(m_logo); m_screenWidget->unsetCursor(); +#ifdef M_CORE_GB + m_display->setMinimumSize(GB_VIDEO_HORIZONTAL_PIXELS, GB_VIDEO_VERTICAL_PIXELS); +#elif defined(M_CORE_GBA) + m_display->setMinimumSize(VIDEO_HORIZONTAL_PIXELS, VIDEO_VERTICAL_PIXELS); +#endif + m_screenWidget->setMinimumSize(m_display->minimumSize()); m_fpsTimer.stop(); m_focusCheck.stop();