mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 15:35:27 +00:00
Merge pull request #6837 from spycrab/qt_position
Qt/RenderWidget: Save position and size using QSettings
This commit is contained in:
commit
99dff10d43
@ -116,11 +116,8 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters) : QMainW
|
|||||||
|
|
||||||
restoreState(settings.value(QStringLiteral("mainwindow/state")).toByteArray());
|
restoreState(settings.value(QStringLiteral("mainwindow/state")).toByteArray());
|
||||||
restoreGeometry(settings.value(QStringLiteral("mainwindow/geometry")).toByteArray());
|
restoreGeometry(settings.value(QStringLiteral("mainwindow/geometry")).toByteArray());
|
||||||
m_render_widget_size =
|
|
||||||
QSize(SConfig::GetInstance().iRenderWindowWidth, SConfig::GetInstance().iRenderWindowHeight);
|
|
||||||
|
|
||||||
m_render_widget_position =
|
m_render_widget_geometry = settings.value(QStringLiteral("renderwidget/geometry")).toByteArray();
|
||||||
QPoint(SConfig::GetInstance().iRenderWindowXPos, SConfig::GetInstance().iRenderWindowYPos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
@ -133,11 +130,7 @@ MainWindow::~MainWindow()
|
|||||||
settings.setValue(QStringLiteral("mainwindow/state"), saveState());
|
settings.setValue(QStringLiteral("mainwindow/state"), saveState());
|
||||||
settings.setValue(QStringLiteral("mainwindow/geometry"), saveGeometry());
|
settings.setValue(QStringLiteral("mainwindow/geometry"), saveGeometry());
|
||||||
|
|
||||||
SConfig::GetInstance().iRenderWindowWidth = m_render_widget_size.width();
|
settings.setValue(QStringLiteral("renderwidget/geometry"), m_render_widget_geometry);
|
||||||
SConfig::GetInstance().iRenderWindowHeight = m_render_widget_size.height();
|
|
||||||
|
|
||||||
SConfig::GetInstance().iRenderWindowXPos = m_render_widget_position.x();
|
|
||||||
SConfig::GetInstance().iRenderWindowYPos = m_render_widget_position.y();
|
|
||||||
|
|
||||||
Config::Save();
|
Config::Save();
|
||||||
}
|
}
|
||||||
@ -592,8 +585,7 @@ bool MainWindow::RequestStop()
|
|||||||
|
|
||||||
if (!m_render_widget->isFullScreen())
|
if (!m_render_widget->isFullScreen())
|
||||||
{
|
{
|
||||||
m_render_widget_size = m_render_widget->size();
|
m_render_widget_geometry = m_render_widget->saveGeometry();
|
||||||
m_render_widget_position = m_render_widget->pos();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SConfig::GetInstance().bConfirmStop)
|
if (SConfig::GetInstance().bConfirmStop)
|
||||||
@ -677,8 +669,7 @@ void MainWindow::FullScreen()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_render_widget_size = m_render_widget->size();
|
m_render_widget_geometry = m_render_widget->saveGeometry();
|
||||||
m_render_widget_position = m_render_widget->pos();
|
|
||||||
m_render_widget->showFullScreen();
|
m_render_widget->showFullScreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -778,10 +769,7 @@ void MainWindow::ShowRenderWidget()
|
|||||||
m_rendering_to_main = false;
|
m_rendering_to_main = false;
|
||||||
|
|
||||||
m_render_widget->showNormal();
|
m_render_widget->showNormal();
|
||||||
m_render_widget->resize(m_render_widget_size);
|
m_render_widget->restoreGeometry(m_render_widget_geometry);
|
||||||
|
|
||||||
if (m_render_widget_position.x() != -1)
|
|
||||||
m_render_widget->move(m_render_widget_position);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SetFullScreenResolution(false);
|
SetFullScreenResolution(false);
|
||||||
|
@ -195,6 +195,5 @@ private:
|
|||||||
RegisterWidget* m_register_widget;
|
RegisterWidget* m_register_widget;
|
||||||
WatchWidget* m_watch_widget;
|
WatchWidget* m_watch_widget;
|
||||||
CheatsManager* m_cheats_manager;
|
CheatsManager* m_cheats_manager;
|
||||||
QSize m_render_widget_size;
|
QByteArray m_render_widget_geometry;
|
||||||
QPoint m_render_widget_position;
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user