remember geometry
This commit is contained in:
parent
77f31b63aa
commit
e447206082
|
@ -30,8 +30,12 @@ MainWindow::MainWindow(bool useNotifySend, QWidget *parent)
|
|||
m_centralWidget = new CentralWidget(this);
|
||||
setCentralWidget(m_centralWidget);
|
||||
setupTrayIcon();
|
||||
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,9 +118,11 @@ 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 New Issue