Let Qt handle system tray icon availability

PR #17519.
This commit is contained in:
Vladimir Golovnev
2022-08-31 08:02:44 +03:00
committed by GitHub
parent 670b381df7
commit 646322b2a2
3 changed files with 26 additions and 45 deletions

View File

@@ -1507,13 +1507,10 @@ void MainWindow::reloadSessionStats()
MacUtils::setBadgeLabelText({});
}
#else
if (app()->desktopIntegration()->isActive())
{
const auto toolTip = u"%1\n%2"_qs.arg(
tr("DL speed: %1", "e.g: Download speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadDownloadRate, true))
, tr("UP speed: %1", "e.g: Upload speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadUploadRate, true)));
app()->desktopIntegration()->setToolTip(toolTip); // tray icon
}
const auto toolTip = u"%1\n%2"_qs.arg(
tr("DL speed: %1", "e.g: Download speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadDownloadRate, true))
, tr("UP speed: %1", "e.g: Upload speed: 10 KiB/s").arg(Utils::Misc::friendlyUnit(status.payloadUploadRate, true)));
app()->desktopIntegration()->setToolTip(toolTip); // tray icon
#endif // Q_OS_MACOS
if (m_displaySpeedInTitle)