mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Revamp system tray icon menu handling
Update system tray icon menu without re-create it. PR #20597. Closes #20516.
This commit is contained in:
parent
489bacd766
commit
5e8b9df859
5 changed files with 14 additions and 82 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Bittorrent Client using Qt and libtorrent.
|
||||
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2015-2024 Vladimir Golovnev <glassez@yandex.ru>
|
||||
* Copyright (C) 2006 Christophe Dumez
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
@ -832,7 +832,7 @@ int Application::exec()
|
|||
m_desktopIntegration = new DesktopIntegration;
|
||||
m_desktopIntegration->setToolTip(tr("Loading torrents..."));
|
||||
#ifndef Q_OS_MACOS
|
||||
auto *desktopIntegrationMenu = new QMenu;
|
||||
auto *desktopIntegrationMenu = m_desktopIntegration->menu();
|
||||
auto *actionExit = new QAction(tr("E&xit"), desktopIntegrationMenu);
|
||||
actionExit->setIcon(UIThemeManager::instance()->getIcon(u"application-exit"_s));
|
||||
actionExit->setMenuRole(QAction::QuitRole);
|
||||
|
@ -843,8 +843,6 @@ int Application::exec()
|
|||
});
|
||||
desktopIntegrationMenu->addAction(actionExit);
|
||||
|
||||
m_desktopIntegration->setMenu(desktopIntegrationMenu);
|
||||
|
||||
const bool isHidden = m_desktopIntegration->isActive() && (startUpWindowState() == WindowState::Hidden);
|
||||
#else
|
||||
const bool isHidden = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue