qt, refactor: Replace BitcoinGUI::macosDockIconActivated with a lambda

This commit is contained in:
Hennadii Stepanov 2022-02-08 16:19:12 +02:00
parent 8afcc89a8f
commit c3ca8364b2
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 4 additions and 10 deletions

View file

@ -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()

View file

@ -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 */