Add status bar menu with DL/UL display on macOS

Implements a native macOS status bar item that displays the qBittorrent icon and provides a minimal menu showing live download and upload rates. This allows quick network activity checks without switching to the app window or relying on the Dock.

Closes #22545.
PR #23098.
This commit is contained in:
Dru Still
2025-08-31 09:06:42 -04:00
committed by GitHub
parent 5e11f4dc5e
commit 8daa87d9de
7 changed files with 256 additions and 3 deletions

View File

@@ -105,6 +105,7 @@
#ifdef Q_OS_MACOS
#include "macosdockbadge/badger.h"
#include "macosstatusitem/statusitem.h"
#endif
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS)
#include "programupdater.h"
@@ -138,6 +139,7 @@ MainWindow::MainWindow(IGUIApplication *app, const WindowState initialState, con
, m_storeExecutionLogTypes {EXECUTIONLOG_SETTINGS_KEY(u"Types"_s), Log::MsgType::ALL}
#ifdef Q_OS_MACOS
, m_badger {std::make_unique<MacUtils::Badger>()}
, m_statusItem {std::make_unique<MacUtils::StatusItem>()}
#endif // Q_OS_MACOS
{
m_ui->setupUi(this);
@@ -1465,6 +1467,7 @@ void MainWindow::loadSessionStats()
// update global information
#ifdef Q_OS_MACOS
m_badger->updateSpeed(status.payloadDownloadRate, status.payloadUploadRate);
m_statusItem->updateSpeed(status.payloadDownloadRate, status.payloadUploadRate);
#else
refreshTrayIconTooltip();
#endif // Q_OS_MACOS