Qt: Save position of settings windows

This commit is contained in:
Stenzek
2025-11-02 21:53:26 +10:00
parent b0689d54e6
commit b4d71cb66c
3 changed files with 10 additions and 5 deletions

View File

@@ -102,6 +102,9 @@ ControllerSettingsWindow::ControllerSettingsWindow(INISettingsInterface* game_si
}
createWidgets();
if (isEditingGlobalSettings())
QtUtils::RestoreWindowGeometry("ControllerSettingsWindow", this);
}
ControllerSettingsWindow::~ControllerSettingsWindow() = default;
@@ -498,7 +501,9 @@ void ControllerSettingsWindow::createWidgets()
void ControllerSettingsWindow::closeEvent(QCloseEvent* event)
{
QWidget::closeEvent(event);
emit windowClosed();
if (isEditingGlobalSettings())
QtUtils::SaveWindowGeometry("ControllerSettingsWindow", this);
}
void ControllerSettingsWindow::updateListDescription(u32 global_slot, ControllerBindingWidget* widget)

View File

@@ -79,10 +79,6 @@ public:
void clearSettingValue(const char* section, const char* key);
void saveAndReloadGameSettings();
Q_SIGNALS:
void windowClosed();
void inputProfileSwitched();
protected:
void closeEvent(QCloseEvent* event) override;

View File

@@ -47,6 +47,8 @@ SettingsWindow::SettingsWindow() : QWidget()
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
addPages();
connectUi();
QtUtils::RestoreWindowGeometry("SettingsWindow", this);
}
SettingsWindow::SettingsWindow(const GameList::Entry* entry, std::unique_ptr<INISettingsInterface> sif)
@@ -78,6 +80,8 @@ void SettingsWindow::closeEvent(QCloseEvent* event)
// we need to clean up ourselves, since we're not modal
if (isPerGameSettings())
deleteLater();
else
QtUtils::SaveWindowGeometry("SettingsWindow", this);
}
void SettingsWindow::addPages()