Skip to content

Commit e0427c3

Browse files
committed
Modify the Quit button on the Main Window to be a Hide button if the
Tray is active.
1 parent 1742215 commit e0427c3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/core/ui/mainwindow.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,16 @@ void MainWindow::updateUI()
524524
actHideQuit->setText(tr("Quit"));
525525
}
526526

527+
if (_conf->getShowTrayIcon()) {
528+
disconnect(actHideQuit, &QAction::triggered, c, &Core::coreQuit);
529+
connect(actHideQuit, &QAction::triggered, this, &MainWindow::windowHideShow);
530+
actHideQuit->setText(tr("Hide"));
531+
} else {
532+
disconnect(actHideQuit, &QAction::triggered, this, &MainWindow::windowHideShow);
533+
connect(actHideQuit, &QAction::triggered, c, &Core::coreQuit);
534+
actHideQuit->setText(tr("Quit"));
535+
}
536+
527537
// create tray object, but not with the "-n" option
528538
if (!Core::instance()->noWin() && _conf->getShowTrayIcon() && !_trayIcon)
529539
createTray();

0 commit comments

Comments
 (0)