summaryrefslogtreecommitdiff
path: root/src/instancemanagerdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/instancemanagerdialog.cpp')
-rw-r--r--src/instancemanagerdialog.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/instancemanagerdialog.cpp b/src/instancemanagerdialog.cpp
index 71fed78d..d579ea9c 100644
--- a/src/instancemanagerdialog.cpp
+++ b/src/instancemanagerdialog.cpp
@@ -111,7 +111,7 @@ InstanceManagerDialog::InstanceManagerDialog(
{
ui->setupUi(this);
- ui->splitter->setSizes({200, 1});
+ ui->splitter->setSizes({250, 1});
ui->splitter->setStretchFactor(0, 0);
ui->splitter->setStretchFactor(1, 1);
@@ -146,6 +146,32 @@ InstanceManagerDialog::InstanceManagerDialog(
connect(ui->close, &QPushButton::clicked, [&]{ close(); });
}
+void InstanceManagerDialog::showEvent(QShowEvent* e)
+{
+ // there might not be a global Settings object if this is called on startup
+ // when there's no current instance
+ const auto* s = Settings::maybeInstance();
+
+ if (s) {
+ s->geometry().restoreGeometry(this);
+ }
+
+ QDialog::showEvent(e);
+}
+
+void InstanceManagerDialog::done(int r)
+{
+ // there might not be a global Settings object if this is called on startup
+ // when there's no current instance
+ auto* s = Settings::maybeInstance();
+
+ if (s) {
+ s->geometry().saveGeometry(this);
+ }
+
+ QDialog::done(r);
+}
+
void InstanceManagerDialog::updateInstances()
{
auto& m = InstanceManager::singleton();