Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tray icon from system theme only if option is set #18733

Merged
merged 1 commit into from Mar 22, 2023

Conversation

glassez
Copy link
Member

@glassez glassez commented Mar 20, 2023

Currently qBittorrent uses system tray icon from the Linux system theme regardless of whether the corresponding option is enabled. It looks inconsistent/incorrect to me and I believe this should be fixed.

@glassez glassez added OS: Linux Issues specific to Linux distributions GUI GUI-related issues/changes Code cleanup Clean up the code while preserving the same outcome labels Mar 20, 2023
@glassez glassez added this to the 4.6.0 milestone Mar 20, 2023
@glassez glassez requested a review from a team March 20, 2023 12:37
@thalieht
Copy link
Contributor

Now the theme's tray icon is never used even with "Use icons from system theme".

@glassez
Copy link
Member Author

glassez commented Mar 21, 2023

Now the theme's tray icon is never used even with "Use icons from system theme".

Are you sure your system theme contains appropriate icons? I tested it on Linux Mint 21 and there are none (at least in the theme I tested it with). When I copied qbittorrent-tray.svg in theme folder manually it is used by qBittorrent.

@thalieht
Copy link
Contributor

Are you sure your system theme contains appropriate icons?

KDE's breeze theme has qBt tray icon and before this PR it was used unconditionally. Now qBt's own tray icons are used no matter what. I didn't touch any icons.

@glassez
Copy link
Member Author

glassez commented Mar 21, 2023

I tested it on Linux Mint 21 and there are none

In fact, I just checked if a file named qbittorrent-tray.* exists and it wasn't there. Could you check if there is one in KDE? I got an idea why it doesn't work.

@thalieht
Copy link
Contributor

In fact, I just checked if a file named qbittorrent-tray.* exists and it wasn't there. Could you check if there is one in KDE?

Hmm there isn't but there are

/usr/share/icons/breeze-dark/apps/48/qbittorrent.svg
/usr/share/icons/breeze/apps/48/qbittorrent.svg

and according to #15931 (comment) they are used.

@glassez
Copy link
Member Author

glassez commented Mar 21, 2023

@thalieht
Could you try it now?

@thalieht
Copy link
Contributor

Fixed 👍

/off topic
the theme's icon is still always used in qBt title bar

setWindowIcon(UIThemeManager::instance()->getIcon(u"qbittorrent"_qs));

@glassez
Copy link
Member Author

glassez commented Mar 21, 2023

the theme's icon is still always used in qBt title bar

You can trace UIThemeManager::getIcon() to make sure that it never uses the system theme icon if the option is not set (unlike the reverse case, when the built-in icon can be used as a fallback if the system one is missing). So it looks like a problem somewhere outside of qBittorrent.

@glassez glassez merged commit 77bd09b into qbittorrent:master Mar 22, 2023
@glassez glassez deleted the tray-icon branch March 22, 2023 10:51
@glassez glassez mentioned this pull request Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code cleanup Clean up the code while preserving the same outcome GUI GUI-related issues/changes OS: Linux Issues specific to Linux distributions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants