mirror of https://github.com/mgba-emu/mgba.git
Qt: Restore maximized state when starting (fixes #487)
This commit is contained in:
parent
679f36d7c0
commit
53b8fdf856
1
CHANGES
1
CHANGES
|
@ -18,6 +18,7 @@ Other fixes:
|
||||||
- Qt: Fix smudged window icon on Windows
|
- Qt: Fix smudged window icon on Windows
|
||||||
- Qt: Fix saving settings enabling camera when camera name changes (fixes mgba.io/i/2125)
|
- Qt: Fix saving settings enabling camera when camera name changes (fixes mgba.io/i/2125)
|
||||||
- Qt: Fix frames getting backlogged (fixes mgba.io/i/2122)
|
- Qt: Fix frames getting backlogged (fixes mgba.io/i/2122)
|
||||||
|
- Qt: Restore maximized state when starting (fixes mgba.io/i/487)
|
||||||
Misc:
|
Misc:
|
||||||
- Core: Truncate preloading ROMs that slightly exceed max size (fixes mgba.io/i/2093)
|
- Core: Truncate preloading ROMs that slightly exceed max size (fixes mgba.io/i/2093)
|
||||||
- GBA: Default-enable VBA bug compat for Ruby and Emerald ROM hacks
|
- GBA: Default-enable VBA bug compat for Ruby and Emerald ROM hacks
|
||||||
|
|
|
@ -620,6 +620,7 @@ void Window::showEvent(QShowEvent* event) {
|
||||||
m_wasOpened = true;
|
m_wasOpened = true;
|
||||||
resizeFrame(m_screenWidget->sizeHint());
|
resizeFrame(m_screenWidget->sizeHint());
|
||||||
QVariant windowPos = m_config->getQtOption("windowPos");
|
QVariant windowPos = m_config->getQtOption("windowPos");
|
||||||
|
bool maximized = m_config->getQtOption("maximized").toBool();
|
||||||
QRect geom = windowHandle()->screen()->availableGeometry();
|
QRect geom = windowHandle()->screen()->availableGeometry();
|
||||||
if (!windowPos.isNull() && geom.contains(windowPos.toPoint())) {
|
if (!windowPos.isNull() && geom.contains(windowPos.toPoint())) {
|
||||||
move(windowPos.toPoint());
|
move(windowPos.toPoint());
|
||||||
|
@ -628,6 +629,9 @@ void Window::showEvent(QShowEvent* event) {
|
||||||
rect.moveCenter(geom.center());
|
rect.moveCenter(geom.center());
|
||||||
move(rect.topLeft());
|
move(rect.topLeft());
|
||||||
}
|
}
|
||||||
|
if (maximized) {
|
||||||
|
showMaximized();
|
||||||
|
}
|
||||||
if (m_fullscreenOnStart) {
|
if (m_fullscreenOnStart) {
|
||||||
enterFullScreen();
|
enterFullScreen();
|
||||||
m_fullscreenOnStart = false;
|
m_fullscreenOnStart = false;
|
||||||
|
@ -652,6 +656,7 @@ void Window::hideEvent(QHideEvent* event) {
|
||||||
void Window::closeEvent(QCloseEvent* event) {
|
void Window::closeEvent(QCloseEvent* event) {
|
||||||
emit shutdown();
|
emit shutdown();
|
||||||
m_config->setQtOption("windowPos", pos());
|
m_config->setQtOption("windowPos", pos());
|
||||||
|
m_config->setQtOption("maximized", isMaximized());
|
||||||
|
|
||||||
if (m_savedScale > 0) {
|
if (m_savedScale > 0) {
|
||||||
m_config->setOption("height", GBA_VIDEO_VERTICAL_PIXELS * m_savedScale);
|
m_config->setOption("height", GBA_VIDEO_VERTICAL_PIXELS * m_savedScale);
|
||||||
|
|
Loading…
Reference in New Issue