From f180612150383ebbc0142f534749037e986100b9 Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Mon, 29 Oct 2018 17:09:17 -0700 Subject: [PATCH] #21 Remember window size/position --- src/mainwindow.cpp | 9 +++++++++ src/mainwindow.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4ad0eaa..ce53a8e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -22,6 +22,9 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); + QSettings s; + restoreGeometry(s.value("geometry").toByteArray()); + // Status Bar setupStatusBar(); @@ -68,6 +71,12 @@ MainWindow::MainWindow(QWidget *parent) : rpc->refresh(true); // Force refresh first time } +void MainWindow::closeEvent(QCloseEvent* event) { + QSettings s; + s.setValue("geometry", saveGeometry()); + QWidget::closeEvent(event); +} + void MainWindow::turnstileProgress() { Ui_TurnstileProgress progress; QDialog d(this); diff --git a/src/mainwindow.h b/src/mainwindow.h index 0dce7c9..ca42422 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -43,6 +43,8 @@ public: QLabel* loadingLabel; private: + void closeEvent(QCloseEvent* event); + void setupSendTab(); void setupTransactionsTab(); void setupRecieveTab();