remember geometry
This commit is contained in:
parent
77f31b63aa
commit
e447206082
1 changed files with 9 additions and 3 deletions
|
@ -30,8 +30,12 @@ MainWindow::MainWindow(bool useNotifySend, QWidget *parent)
|
|||
m_centralWidget = new CentralWidget(this);
|
||||
setCentralWidget(m_centralWidget);
|
||||
setupTrayIcon();
|
||||
resize(1000, 700);
|
||||
showMaximized();
|
||||
if (m_settings->contains("geometry")) {
|
||||
restoreGeometry(m_settings->value("geometry").toByteArray());
|
||||
} else {
|
||||
resize(1000, 700);
|
||||
showMaximized();
|
||||
}
|
||||
if (m_settings->value("trayIcon", false).toBool() &&
|
||||
m_settings->value("startHidden", false).toBool()) {
|
||||
hide();
|
||||
|
@ -114,8 +118,10 @@ void MainWindow::setTrayIcon(bool enabled) {
|
|||
void MainWindow::closeEvent(QCloseEvent *event) {
|
||||
if (m_settings->value("trayIcon", false).toBool()) {
|
||||
hide();
|
||||
} else
|
||||
} else {
|
||||
m_settings->setValue("geometry", saveGeometry());
|
||||
QApplication::quit();
|
||||
}
|
||||
}
|
||||
|
||||
MainWindow *MainWindow::instance() { return m_instance; }
|
||||
|
|
Loading…
Reference in a new issue