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);
|
m_centralWidget = new CentralWidget(this);
|
||||||
setCentralWidget(m_centralWidget);
|
setCentralWidget(m_centralWidget);
|
||||||
setupTrayIcon();
|
setupTrayIcon();
|
||||||
resize(1000, 700);
|
if (m_settings->contains("geometry")) {
|
||||||
showMaximized();
|
restoreGeometry(m_settings->value("geometry").toByteArray());
|
||||||
|
} else {
|
||||||
|
resize(1000, 700);
|
||||||
|
showMaximized();
|
||||||
|
}
|
||||||
if (m_settings->value("trayIcon", false).toBool() &&
|
if (m_settings->value("trayIcon", false).toBool() &&
|
||||||
m_settings->value("startHidden", false).toBool()) {
|
m_settings->value("startHidden", false).toBool()) {
|
||||||
hide();
|
hide();
|
||||||
|
@ -114,8 +118,10 @@ void MainWindow::setTrayIcon(bool enabled) {
|
||||||
void MainWindow::closeEvent(QCloseEvent *event) {
|
void MainWindow::closeEvent(QCloseEvent *event) {
|
||||||
if (m_settings->value("trayIcon", false).toBool()) {
|
if (m_settings->value("trayIcon", false).toBool()) {
|
||||||
hide();
|
hide();
|
||||||
} else
|
} else {
|
||||||
|
m_settings->setValue("geometry", saveGeometry());
|
||||||
QApplication::quit();
|
QApplication::quit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow *MainWindow::instance() { return m_instance; }
|
MainWindow *MainWindow::instance() { return m_instance; }
|
||||||
|
|
Loading…
Reference in New Issue