mirror of https://github.com/mgba-emu/mgba.git
Qt: Manage window sizes slightly better
This commit is contained in:
parent
0a791a2f7d
commit
0b2f8bb4dc
1
CHANGES
1
CHANGES
|
@ -36,6 +36,7 @@ Misc:
|
||||||
- GB Video: Improved video timings
|
- GB Video: Improved video timings
|
||||||
- All: Split out install locations for Libretro and OpenEmu
|
- All: Split out install locations for Libretro and OpenEmu
|
||||||
- GBA Video: Clean up unused timers
|
- GBA Video: Clean up unused timers
|
||||||
|
- Qt: Manage window sizes slightly better
|
||||||
|
|
||||||
0.5.0: (2016-09-19)
|
0.5.0: (2016-09-19)
|
||||||
Features:
|
Features:
|
||||||
|
|
|
@ -114,6 +114,7 @@ ConfigController::ConfigController(QObject* parent)
|
||||||
m_opts.rewindBufferCapacity = 300;
|
m_opts.rewindBufferCapacity = 300;
|
||||||
m_opts.useBios = true;
|
m_opts.useBios = true;
|
||||||
m_opts.suspendScreensaver = true;
|
m_opts.suspendScreensaver = true;
|
||||||
|
m_opts.lockAspectRatio = true;
|
||||||
mCoreConfigLoad(&m_config);
|
mCoreConfigLoad(&m_config);
|
||||||
mCoreConfigLoadDefaults(&m_config, &m_opts);
|
mCoreConfigLoadDefaults(&m_config, &m_opts);
|
||||||
mCoreConfigMap(&m_config, &m_opts);
|
mCoreConfigMap(&m_config, &m_opts);
|
||||||
|
|
|
@ -9,7 +9,11 @@
|
||||||
#include "DisplayQt.h"
|
#include "DisplayQt.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
#ifdef M_CORE_GB
|
||||||
#include "gb/video.h"
|
#include "gb/video.h"
|
||||||
|
#elif defined(M_CORE_GBA)
|
||||||
|
#include "gba/video.h"
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace QGBA;
|
using namespace QGBA;
|
||||||
|
@ -55,7 +59,11 @@ Display::Display(QWidget* parent)
|
||||||
, m_filter(false)
|
, m_filter(false)
|
||||||
{
|
{
|
||||||
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||||
|
#ifdef M_CORE_GB
|
||||||
setMinimumSize(GB_VIDEO_HORIZONTAL_PIXELS, GB_VIDEO_VERTICAL_PIXELS);
|
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()));
|
connect(&m_mouseTimer, SIGNAL(timeout()), this, SIGNAL(hideCursor()));
|
||||||
m_mouseTimer.setSingleShot(true);
|
m_mouseTimer.setSingleShot(true);
|
||||||
m_mouseTimer.setInterval(MOUSE_DISAPPEAR_TIMER);
|
m_mouseTimer.setInterval(MOUSE_DISAPPEAR_TIMER);
|
||||||
|
|
|
@ -89,7 +89,9 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent)
|
||||||
|
|
||||||
m_screenWidget->setMinimumSize(m_display->minimumSize());
|
m_screenWidget->setMinimumSize(m_display->minimumSize());
|
||||||
m_screenWidget->setSizePolicy(m_display->sizePolicy());
|
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->setPixmap(m_logo);
|
||||||
m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height());
|
m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height());
|
||||||
setCentralWidget(m_screenWidget);
|
setCentralWidget(m_screenWidget);
|
||||||
|
@ -705,6 +707,7 @@ void Window::gameStarted(mCoreThread* context, const QString& fname) {
|
||||||
unsigned width, height;
|
unsigned width, height;
|
||||||
context->core->desiredVideoDimensions(context->core, &width, &height);
|
context->core->desiredVideoDimensions(context->core, &width, &height);
|
||||||
m_display->setMinimumSize(width, height);
|
m_display->setMinimumSize(width, height);
|
||||||
|
m_screenWidget->setMinimumSize(m_display->minimumSize());
|
||||||
attachWidget(m_display);
|
attachWidget(m_display);
|
||||||
|
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
|
@ -733,6 +736,12 @@ void Window::gameStopped() {
|
||||||
m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height());
|
m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height());
|
||||||
m_screenWidget->setPixmap(m_logo);
|
m_screenWidget->setPixmap(m_logo);
|
||||||
m_screenWidget->unsetCursor();
|
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_fpsTimer.stop();
|
||||||
m_focusCheck.stop();
|
m_focusCheck.stop();
|
||||||
|
|
Loading…
Reference in New Issue