separate stylesheet-dark.qss for dark mode theme and stylesheet.qss for light mode #16689

Open
opened 2026-02-22 03:20:25 -05:00 by deekerman · 6 comments
Owner

Originally created by @b-user on GitHub (Mar 9, 2025).

Originally assigned to: @glassez on GitHub.

Suggestion

I would like to use separate stylesheet-dark.qss for dark mode theme and stylesheet.qss for light. mode
This feature is currently unavailable.
A separate style sheet for dark mode and light mode would allow for a universal theme.

Currently it is possible to use stylesheet.qss for both modes (light and dark):
github.com/qbittorrent/qBittorrent@53f919aea8/src/gui/uithemecommon.h (L42)
github.com/qbittorrent/qBittorrent@53f919aea8/src/gui/uithemesource.cpp (L243)

Please consider this opportunity.

Use case

A separate style sheet for dark mode and light mode would allow for a universal theme.

Extra info/examples/attachments

No response

Originally created by @b-user on GitHub (Mar 9, 2025). Originally assigned to: @glassez on GitHub. ### Suggestion I would like to use **separate stylesheet-dark.qss for dark** mode theme and **stylesheet.qss for light**. mode This feature is currently unavailable. A separate style sheet for dark mode and light mode would allow for a universal theme. Currently it is possible to use stylesheet.qss for both modes (light and dark): https://github.com/qbittorrent/qBittorrent/blob/53f919aea823f771d71e4c97d1f651c1c72a5454/src/gui/uithemecommon.h#L42 https://github.com/qbittorrent/qBittorrent/blob/53f919aea823f771d71e4c97d1f651c1c72a5454/src/gui/uithemesource.cpp#L243 Please consider this opportunity. ### Use case A separate style sheet for dark mode and light mode would allow for a universal theme. ### Extra info/examples/attachments _No response_
Author
Owner

@glassez commented on GitHub (Mar 12, 2025):

A separate style sheet for dark mode and light mode would allow for a universal theme.

I wonder what exactly you're going to provide through stylesheet, which should be different depending on the dark or light mode.

@glassez commented on GitHub (Mar 12, 2025): > A separate style sheet for dark mode and light mode would allow for a universal theme. I wonder what exactly you're going to provide through stylesheet, which should be different depending on the dark or light mode.
Author
Owner

@b-user commented on GitHub (Mar 12, 2025):

I have two "homemade" themes for qBittorrent: one for light mode, the second for dark mode.
I want to compile one universal theme from these two.

The purpose of creating a universal theme:
I want to avoid having to go into the qBittorrent settings every time to switch themes.

@b-user commented on GitHub (Mar 12, 2025): I have two "homemade" themes for qBittorrent: one for light mode, the second for dark mode. I want to compile one universal theme from these two. The purpose of creating a universal theme: I want to avoid having to go into the qBittorrent settings every time to switch themes.
Author
Owner

@glassez commented on GitHub (Mar 12, 2025):

I have two "homemade" themes for qBittorrent: one for light mode, the second for dark mode. I want to compile one universal theme from these two.

The purpose of creating a universal theme: I want to avoid having to go into the qBittorrent settings every time to switch themes.

You did not answer my question, but repeated what was said above.

I understand that you want to make a universal theme.
I also understand that in general it is better to provide different sets of icons and colors for dark and light modes.
But what is it that you provide through stylesheet that should be different for dark and light modes (considering that it will end up being essentially the same theme, rather than two different themes packaged in single bundle)?

@glassez commented on GitHub (Mar 12, 2025): > I have two "homemade" themes for qBittorrent: one for light mode, the second for dark mode. I want to compile one universal theme from these two. > > The purpose of creating a universal theme: I want to avoid having to go into the qBittorrent settings every time to switch themes. You did not answer my question, but repeated what was said above. I understand that you want to make a universal theme. I also understand that in general it is better to provide different sets of icons and colors for dark and light modes. But what is it that you provide through stylesheet that should be different for dark and light modes (considering that it will end up being essentially the same theme, rather than two different themes packaged in single bundle)?
Author
Owner

@b-user commented on GitHub (Mar 12, 2025):

For example, a slightly different background color for windows/menus than the system color.

@b-user commented on GitHub (Mar 12, 2025): For example, a slightly different background color for windows/menus than the system color.
Author
Owner

@glassez commented on GitHub (Mar 13, 2025):

@b-user
There is some difficulty in this matter.
The fact is that qBittorrent chooses colors and icons based not on the color mode itself, but on the "lightness" of the current palette of the application. This is done in order to avoid using inappropriate colors and icons in the case when the current style does not support the current color mode (as, for example, WindowsVista style does not support dark mode).
This is clearly not suitable for choosing a stylesheet since the stylesheet itself is supposed to be able to change application palette.
Therefore the solution can be a different interpretation of the "color mode" when choosing one or another element of the theme implementation, i.e. icons and colors will continue to use the palette "lightness", and the stylesheet will use the color mode directly. The algorithm could be as follows:

  1. Check the color mode and apply an appropriate stylesheet (which could affect the application palette)
  2. Check the application palette and apply appropriate icons/colors
@glassez commented on GitHub (Mar 13, 2025): @b-user There is some difficulty in this matter. The fact is that qBittorrent chooses colors and icons based not on the color mode itself, but on the "lightness" of the current palette of the application. This is done in order to avoid using inappropriate colors and icons in the case when the current style does not support the current color mode (as, for example, WindowsVista style does not support dark mode). This is clearly not suitable for choosing a stylesheet since the stylesheet itself is supposed to be able to change application palette. Therefore the solution can be a different interpretation of the "color mode" when choosing one or another element of the theme implementation, i.e. icons and colors will continue to use the palette "lightness", and the stylesheet will use the color mode directly. The algorithm could be as follows: 1. Check the color mode and apply an appropriate stylesheet (which could affect the application palette) 2. Check the application palette and apply appropriate icons/colors
Author
Owner

@xavier2k6 commented on GitHub (May 25, 2025):

ANNOUNCEMENT!

For anybody coming across this "Feature Request" & would like/love to see a potential implementation in the future!
Here are some options available to you:

  1. Please select/click the 👍 &/orreactions in the original/opening post of this ticket.

  2. Please feel free (If you have the "skillset") to create a "Pull Request" implementing what's being requested in this ticket.
    (new/existing contributors/developers are always welcome)


DO:

  • Provide constructive feedback.
  • Display how other projects implemented same/similar etc.

DO NOT:

  • Add a "Bump", "me too", "2nd/3rd" etc. or "criticizing" comment(s).
    (These will be disregarded/hidden as "spam/abuse/off-topic" etc. as they don't provide anything constructive.)
@xavier2k6 commented on GitHub (May 25, 2025): ## ANNOUNCEMENT! For anybody coming across this **_"Feature Request"_** & would like/love to see a potential implementation in the future! **Here are some options available to you:** 1. Please select/click the 👍 **&/or** ❤ `reactions` in the original/opening post of this ticket. 2. Please feel free _(If you have the "skillset")_ to create a **_"Pull Request"_** implementing what's being requested in this ticket. **_(new/existing contributors/developers are always welcome)_** ____ **DO:** * Provide constructive feedback. * Display how other projects implemented same/similar etc. **DO NOT:** * Add a "Bump", "me too", "2nd/3rd" etc. or "criticizing" comment(s). **(These will be disregarded/hidden as "spam/abuse/off-topic" etc. as they don't provide anything constructive.)**
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#16689
No description provided.