parent
27d6f881cd
commit
a50c978ce3
|
@ -1531,18 +1531,20 @@ void MainWindow::showEvent(QShowEvent *e) {
|
||||||
void MainWindow::closeEvent(QCloseEvent *e) {
|
void MainWindow::closeEvent(QCloseEvent *e) {
|
||||||
|
|
||||||
if (!hidden_ && keep_running_ && e->spontaneous() && QSystemTrayIcon::isSystemTrayAvailable()) {
|
if (!hidden_ && keep_running_ && e->spontaneous() && QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||||
e->ignore();
|
|
||||||
SetHiddenInTray(true);
|
SetHiddenInTray(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Exit();
|
Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QMainWindow::closeEvent(e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::SetHiddenInTray(const bool hidden) {
|
void MainWindow::SetHiddenInTray(const bool hidden) {
|
||||||
|
|
||||||
hidden_ = hidden;
|
hidden_ = hidden;
|
||||||
|
settings_.setValue("hidden", hidden_);
|
||||||
|
|
||||||
// Some window managers don't remember maximized state between calls to hide() and show(), so we have to remember it ourself.
|
// Some window managers don't remember maximized state between calls to hide() and show(), so we have to remember it ourself.
|
||||||
if (hidden) {
|
if (hidden) {
|
||||||
|
|
Loading…
Reference in New Issue