From b3160a17ea1a8731c4d818ddc711d76b90464f46 Mon Sep 17 00:00:00 2001 From: thez3ro Date: Mon, 8 May 2017 23:27:54 +0200 Subject: [PATCH] enable minimize on close for macOS --- src/gui/MainWindow.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 0415f2b4..c3ab306e 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -660,8 +660,12 @@ void MainWindow::databaseTabChanged(int tabIndex) void MainWindow::closeEvent(QCloseEvent* event) { - bool minimizeOnClose = isTrayIconEnabled() && - config()->get("GUI/MinimizeOnClose").toBool(); + bool minimizeOnClose = config()->get("GUI/MinimizeOnClose").toBool(); +#ifndef Q_OS_MAC + // if we aren't on OS X, check if the tray is enabled. + // on OS X we are using the dock for the minimize action + minimizeOnClose = isTrayIconEnabled() && minimizeOnClose; +#endif if (minimizeOnClose && !appExitCalled) { event->ignore();