mirror of https://github.com/mgba-emu/mgba.git
Qt: Restore maximized state when starting (fixes #487)
This commit is contained in:
parent
a7c451708f
commit
e6fb9f44a7
1
CHANGES
1
CHANGES
|
@ -20,6 +20,7 @@ Other fixes:
|
|||
- Qt: Fix smudged window icon on Windows
|
||||
- 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: Restore maximized state when starting (fixes mgba.io/i/487)
|
||||
Misc:
|
||||
- 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
|
||||
|
|
|
@ -668,6 +668,7 @@ void Window::showEvent(QShowEvent* event) {
|
|||
m_wasOpened = true;
|
||||
resizeFrame(m_screenWidget->sizeHint());
|
||||
QVariant windowPos = m_config->getQtOption("windowPos");
|
||||
bool maximized = m_config->getQtOption("maximized").toBool();
|
||||
QRect geom = windowHandle()->screen()->availableGeometry();
|
||||
if (!windowPos.isNull() && geom.contains(windowPos.toPoint())) {
|
||||
move(windowPos.toPoint());
|
||||
|
@ -676,6 +677,9 @@ void Window::showEvent(QShowEvent* event) {
|
|||
rect.moveCenter(geom.center());
|
||||
move(rect.topLeft());
|
||||
}
|
||||
if (maximized) {
|
||||
showMaximized();
|
||||
}
|
||||
if (m_fullscreenOnStart) {
|
||||
enterFullScreen();
|
||||
m_fullscreenOnStart = false;
|
||||
|
@ -700,6 +704,7 @@ void Window::hideEvent(QHideEvent* event) {
|
|||
void Window::closeEvent(QCloseEvent* event) {
|
||||
emit shutdown();
|
||||
m_config->setQtOption("windowPos", pos());
|
||||
m_config->setQtOption("maximized", isMaximized());
|
||||
|
||||
if (m_savedScale > 0) {
|
||||
m_config->setOption("height", GBA_VIDEO_VERTICAL_PIXELS * m_savedScale);
|
||||
|
|
Loading…
Reference in New Issue