diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-02-08 16:21:45 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-02-08 16:21:45 +0200 |
commit | 66afa286e519deda2fcfd580f190b7af13407e72 (patch) | |
tree | e9a75ed38d758d514ab255f1e961f72f56a57e7c /src/qt/bitcoingui.cpp | |
parent | c3ca8364b2a8de8c73ecc0c7eed9608bd30e7e02 (diff) | |
download | bitcoin-66afa286e519deda2fcfd580f190b7af13407e72.tar.xz |
qt, refactor: Replace BitcoinGUI::trayIconActivated with a lambda
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index ca351060fd..dd3e1b41a7 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -789,7 +789,12 @@ void BitcoinGUI::createTrayIconMenu() return; trayIcon->setContextMenu(trayIconMenu.get()); - connect(trayIcon, &QSystemTrayIcon::activated, this, &BitcoinGUI::trayIconActivated); + connect(trayIcon, &QSystemTrayIcon::activated, [this](QSystemTrayIcon::ActivationReason reason) { + if (reason == QSystemTrayIcon::Trigger) { + // Click on system tray icon triggers show/hide of the main window + toggleHidden(); + } + }); #else // Note: On macOS, the Dock icon is used to provide the tray's functionality. MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); @@ -822,17 +827,6 @@ void BitcoinGUI::createTrayIconMenu() #endif } -#ifndef Q_OS_MAC -void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) -{ - if(reason == QSystemTrayIcon::Trigger) - { - // Click on system tray icon triggers show/hide of the main window - toggleHidden(); - } -} -#endif - void BitcoinGUI::optionsClicked() { openOptionsDialogWithTab(OptionsDialog::TAB_MAIN); |