diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-02-08 16:19:12 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-02-08 16:19:12 +0200 |
commit | c3ca8364b2a8de8c73ecc0c7eed9608bd30e7e02 (patch) | |
tree | 1d3e5f242bf564bf66fbea5ce95090f2a4b44125 /src/qt | |
parent | 8afcc89a8f96692dd880b6102c9a85fac18b9021 (diff) |
qt, refactor: Replace BitcoinGUI::macosDockIconActivated with a lambda
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoingui.cpp | 11 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 3 |
2 files changed, 4 insertions, 10 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 0baacfe58c..ca351060fd 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -793,7 +793,10 @@ void BitcoinGUI::createTrayIconMenu() #else // Note: On macOS, the Dock icon is used to provide the tray's functionality. MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); - connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, this, &BitcoinGUI::macosDockIconActivated); + connect(dockIconHandler, &MacDockIconHandler::dockIconClicked, [this] { + show(); + activateWindow(); + }); trayIconMenu->setAsDockMenu(); #endif @@ -828,12 +831,6 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) toggleHidden(); } } -#else -void BitcoinGUI::macosDockIconActivated() -{ - show(); - activateWindow(); -} #endif void BitcoinGUI::optionsClicked() diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 658ab5a210..ae9cb9f11d 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -305,9 +305,6 @@ public Q_SLOTS: #ifndef Q_OS_MAC /** Handle tray icon clicked */ void trayIconActivated(QSystemTrayIcon::ActivationReason reason); -#else - /** Handle macOS Dock icon clicked */ - void macosDockIconActivated(); #endif /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */ |