{"action":"created","issue":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7065","repository_url":"https://api.github.com/repos/qbittorrent/qBittorrent","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7065/labels{/name}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7065/comments","events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7065/events","html_url":"https://github.com/qbittorrent/qBittorrent/pull/7065","id":240618636,"number":7065,"title":"Use SVG files for monochrome tray icons. Closes #6085.","user":{"login":"evsh","id":394621,"avatar_url":"https://avatars3.githubusercontent.com/u/394621?v=3","gravatar_id":"","url":"https://api.github.com/users/evsh","html_url":"https://github.com/evsh","followers_url":"https://api.github.com/users/evsh/followers","following_url":"https://api.github.com/users/evsh/following{/other_user}","gists_url":"https://api.github.com/users/evsh/gists{/gist_id}","starred_url":"https://api.github.com/users/evsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evsh/subscriptions","organizations_url":"https://api.github.com/users/evsh/orgs","repos_url":"https://api.github.com/users/evsh/repos","events_url":"https://api.github.com/users/evsh/events{/privacy}","received_events_url":"https://api.github.com/users/evsh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-07-05T11:18:06Z","updated_at":"2017-07-05T15:44:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7065","html_url":"https://github.com/qbittorrent/qBittorrent/pull/7065","diff_url":"https://github.com/qbittorrent/qBittorrent/pull/7065.diff","patch_url":"https://github.com/qbittorrent/qBittorrent/pull/7065.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/comments/313142719","html_url":"https://github.com/qbittorrent/qBittorrent/pull/7065#issuecomment-313142719","issue_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7065","id":313142719,"user":{"login":"evsh","id":394621,"avatar_url":"https://avatars3.githubusercontent.com/u/394621?v=3","gravatar_id":"","url":"https://api.github.com/users/evsh","html_url":"https://github.com/evsh","followers_url":"https://api.github.com/users/evsh/followers","following_url":"https://api.github.com/users/evsh/following{/other_user}","gists_url":"https://api.github.com/users/evsh/gists{/gist_id}","starred_url":"https://api.github.com/users/evsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evsh/subscriptions","organizations_url":"https://api.github.com/users/evsh/orgs","repos_url":"https://api.github.com/users/evsh/repos","events_url":"https://api.github.com/users/evsh/events{/privacy}","received_events_url":"https://api.github.com/users/evsh/received_events","type":"User","site_admin":false},"created_at":"2017-07-05T15:44:10Z","updated_at":"2017-07-05T15:44:10Z","body":"System tray contents in Plasma (and most likely in GNOME) are transferred from an app to the system tray via DBus (system tray is in another process). Icon can be transferred either as icon name from the current icon theme, or as a pixmap. When we use an SVG icon for tray, I would expect from the QPA plugin to generate a pixmap out of it automatically, but it is not the case.\r\n\r\nWe have therefore three options:\r\n1. Generate pixmap from SVG either in app\r\n```diff\r\ndiff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp\r\nindex c6dc18364..073fa308d 100644\r\n--- a/src/gui/mainwindow.cpp\r\n+++ b/src/gui/mainwindow.cpp\r\n@@ -1814,16 +1814,24 @@ void MainWindow::checkForActiveTorrents()\r\n QIcon MainWindow::getSystrayIcon() const\r\n {\r\n     TrayIcon::Style style = Preferences::instance()->trayIconStyle();\r\n+    QIcon icon;\r\n     switch (style) {\r\n     case TrayIcon::MONO_DARK:\r\n-        return QIcon(\":/icons/skin/qbittorrent_mono_dark.svg\");\r\n+        icon = QIcon(\":/icons/skin/qbittorrent_mono_dark.svg\");\r\n+        break;\r\n     case TrayIcon::MONO_LIGHT:\r\n-        return QIcon(\":/icons/skin/qbittorrent_mono_light.svg\");\r\n+        icon = QIcon(\":/icons/skin/qbittorrent_mono_light.svg\");\r\n+        break;\r\n     default:\r\n         break;\r\n     }\r\n \r\n-    QIcon icon;\r\n+    // case of SVG icons\r\n+    if (!icon.isNull()) {\r\n+        icon = QIcon(icon.pixmap(128, 128));\r\n+        return icon;\r\n+    }\r\n+\r\n #if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC))\r\n     if (Preferences::instance()->useSystemIconTheme())\r\n         icon = QIcon::fromTheme(\"qbittorrent-tray\");\r\n```\r\n2. Just regenerate PNGs with higher resolution\r\n3. Install qbittorrent_mono_dark.svg and qbittorrent_mono_light.svg in the same way as we install qbittorrent-tray.png\r\n\r\nIMO, the third option is the sanest.\r\n"}}
{"actor":{"display_login":"evsh"}}