Use application icon from current theme instead of the default #37

Closed
opened 2026-02-21 14:49:54 -05:00 by deekerman · 2 comments
Owner

Originally created by @csgabor on GitHub (Aug 23, 2012).

Originally assigned to: @cdumez on GitHub.

Please use the system-provided icon in window header and in the tray when normal tray icon style is selected in the options so the app will blend in with the system's theme.

Here's the patch:

diff -aur qbittorrent-3.0.1/src/mainwindow.cpp qbittorrent-3.0.1_mod/src/mainwindow.cpp
--- qbittorrent-3.0.1/src/mainwindow.cpp    2012-08-21 19:23:09.000000000 +0200
+++ qbittorrent-3.0.1_mod/src/mainwindow.cpp    2012-08-23 15:25:41.132916937 +0200
@@ -105,7 +105,7 @@
   // Clean exit on log out
   connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession()));
   // Setting icons
-  this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")));
+  this->setWindowIcon(QIcon::fromTheme("qbittorrent", QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png"))));
   actionOpen->setIcon(IconProvider::instance()->getIcon("list-add"));
   actionDownload_from_URL->setIcon(IconProvider::instance()->getIcon("insert-link"));
   actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
@@ -1402,5 +1402,5 @@
   icon.addFile(":/Icons/skin/qbittorrent22.png", QSize(22, 22));
   icon.addFile(":/Icons/skin/qbittorrent16.png", QSize(16, 16));
   icon.addFile(":/Icons/skin/qbittorrent32.png", QSize(32, 32));
-  return icon;
+  return QIcon::fromTheme("qbittorrent", icon);
 }
Originally created by @csgabor on GitHub (Aug 23, 2012). Originally assigned to: @cdumez on GitHub. Please use the system-provided icon in window header and in the tray when normal tray icon style is selected in the options so the app will blend in with the system's theme. Here's the patch: ``` diff diff -aur qbittorrent-3.0.1/src/mainwindow.cpp qbittorrent-3.0.1_mod/src/mainwindow.cpp --- qbittorrent-3.0.1/src/mainwindow.cpp 2012-08-21 19:23:09.000000000 +0200 +++ qbittorrent-3.0.1_mod/src/mainwindow.cpp 2012-08-23 15:25:41.132916937 +0200 @@ -105,7 +105,7 @@ // Clean exit on log out connect(static_cast<SessionApplication*>(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession())); // Setting icons - this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png"))); + this->setWindowIcon(QIcon::fromTheme("qbittorrent", QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png")))); actionOpen->setIcon(IconProvider::instance()->getIcon("list-add")); actionDownload_from_URL->setIcon(IconProvider::instance()->getIcon("insert-link")); actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png"))); @@ -1402,5 +1402,5 @@ icon.addFile(":/Icons/skin/qbittorrent22.png", QSize(22, 22)); icon.addFile(":/Icons/skin/qbittorrent16.png", QSize(16, 16)); icon.addFile(":/Icons/skin/qbittorrent32.png", QSize(32, 32)); - return icon; + return QIcon::fromTheme("qbittorrent", icon); } ```
Author
Owner

@cdumez commented on GitHub (Aug 23, 2012):

Thanks for the patch. This is merged for v3.0.2.

@cdumez commented on GitHub (Aug 23, 2012): Thanks for the patch. This is merged for v3.0.2.
Author
Owner

@surfernsk commented on GitHub (Sep 2, 2012):

Icon from the current theme does not work. Instead, the icon is low resolution, in the set of application icons

Ubuntu 12.04 64bit
Gnome Shell (3.4.1-0ubuntu2)
qt (4.8.1)

@surfernsk commented on GitHub (Sep 2, 2012): Icon from the current theme does not work. Instead, the icon is low resolution, in the set of application icons Ubuntu 12.04 64bit Gnome Shell (3.4.1-0ubuntu2) qt (4.8.1) <a href='http://s1.hostingkartinok.com/uploads/images/2012/09/3f7595b313416688bd4ae2dd32ec8716.png' ><img src='http://s1.hostingkartinok.com/uploads/images/2012/09/3f7595b313416688bd4ae2dd32ec8716.png' /></a>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#37
No description provided.