qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.66k stars 4.01k forks source link

Need way to switch between Dark and Light Mode regardless of System Mode #21421

Open ObedPM opened 2 months ago

ObedPM commented 2 months ago

qBittorrent & operating system versions

qBittorrent: 5.0.0 x64 Operating system: Windows 10 Pro

What is the problem?

How can i change the dark theme? Is set up by default!

Steps to reproduce

No response

Additional context

No response

Log(s) & preferences file(s)

No response

vivadavid commented 2 months ago

Hi,

I have the same problem. I've just updated to version 5.0.0 and, out of the blue, dark mode is enabled by default and I can't find a way to switch back to light mode.

My Windows 11 has always been in dark mode, but, generally speaking, I prefer to have my programmes in light mode.

Is there a way to tell QbitTorrent 5.0.0 that, despite having dark mode in Windows 11, I prefer the programme in light mode?

Thanks!

Pentaphon commented 2 months ago

@ObedPM you should change the title of this issue to something like "Need way to switch between Dark and Light Mode regardless of System Mode".

qBittUser commented 2 months ago

@ObedPM

Is set up by default!

Yes, that's not a bug, qBittorrent v5+ changes theme based on your OS settings. It was made so to resolve Windows qBit users old feature request to have qBittorrent automatically support native Windows theme.

How can I change the dark theme?

  1. Open qBittorrent > Tools > Options
  2. Choose if you want to use a custom theme file or select Customizing UI Theme...

List of custom UI theme files are here: https://github.com/qbittorrent/qBittorrent/wiki/List-of-known-qBittorrent-themes

If you dislike using custom UI theme files to switch between Light or Dark, then change your OS settings and qBittorrent v5+ will automatically switch to be similar to native system theme.

To customize Windows 10 & 11 theme:

  1. Select Start > Settings or Right-click on your Desktop empty area.
  2. Select Personalization > Colors.
  3. In the list for Choose your mode, select it to be Custom, Light or Dark.

If you or anyone else wants more settings and theme related options to be built-in to qBittorrent, then you should create a new feature request.

Alternatively if you want to discuss and share ideas or wish to get more complex workarounds to make qBittorrent look how you want, then please use the Discussions page.

xavier2k6 commented 2 months ago

For those that don't want qBittorrent v5 to automatically switch to Dark "App" mode, here are some choices:

  1. Personalisation->Colours->Choose your color->Custom->Choose your default app mode->Light Screenshot 2024-09-30 091440

  2. Modify qt.conf file with WindowsArguments = darkmode=0 (this will disable qBittorrent's dark "app" mode support.) Screenshot 2024-09-30 091956

sledgehammer999 commented 2 months ago

If you want the native style (used in v4.6.x) Launch qbittorrent.exe like this: <path-to-qbt>/qbittorrent.exe -style WindowsVista The WindowsVista has limited supported for dark mode, if any at all.

The darkmode possible values are explained here: https://doc.qt.io/qt-6/qguiapplication.html#platform-specific-arguments

sledgehammer999 commented 2 months ago

I wonder if we should provide an UI setting "Use native UI style (may disable dark mode)".

xavier2k6 commented 2 months ago

I wonder if we should provide an UI setting "Use native UI style (may disable dark mode)".

and hinder HiDPI support as previously discussed

sledgehammer999 commented 2 months ago

and hinder HiDPI support as previously discussed

Citation? I run HiDPI with fractional scaling and native style since qt5 and I haven't had issues. Can you point me to them?

xavier2k6 commented 2 months ago

Revisit PR https://github.com/qbittorrent/qBittorrent/pull/19051

electrifying commented 2 months ago

If you want the native style (used in v4.6.x) Launch qbittorrent.exe like this: <path-to-qbt>/qbittorrent.exe -style WindowsVista The WindowsVista has limited supported for dark mode, if any at all.

The darkmode possible values are explained here: https://doc.qt.io/qt-6/qguiapplication.html#platform-specific-arguments

now we will always have to do this to get a non-broken interface?

sledgehammer999 commented 2 months ago

Revisit PR #19051

AFAICT, you mentioned HiDPI here and I answered here. Aka Qt6 doesn't have a recommendation for Fusion+hidpi anymore.

qBittUser commented 2 months ago

@electrifying

now we will always have to do this to get a non-broken interface?

If something is broken, then a proper new issue report needs to be made.

xavier2k6 commented 2 months ago

@electrifying

now we will always have to do this to get a non-broken interface?

If something is broken, then a proper new issue report needs to be made.

they came here from #21423

xavier2k6 commented 2 months ago

Revisit PR #19051

AFAICT, you mentioned HiDPI here and I answered here. Aka Qt6 doesn't have a recommendation for Fusion+hidpi anymore.

ok, but Qt still prefer it (fusion style) in Qt 6 for Windows 11 (although....since then they now also have introduces a windows11 style) https://github.com/qbittorrent/qBittorrent/pull/19051#issuecomment-1572041773

xavier2k6 commented 2 months ago

Also, see my other https://github.com/qbittorrent/qBittorrent/pull/19051#issuecomment-1572158500

sledgehammer999 commented 2 months ago

Revisit PR #19051

AFAICT, you mentioned HiDPI here and I answered here. Aka Qt6 doesn't have a recommendation for Fusion+hidpi anymore.

ok, but Qt still prefer it (fusion style) in Qt 6 for Windows 11 (although....since then they now also have introduces a windows11 style) #19051 (comment)

Sure. They recommend it for dark mode, regardless of hidpi.

xavier2k6 commented 2 months ago

Qt 6 is Per-Monitor DPI Aware V2

https://doc.qt.io/qt-6/highdpi.html

Qt 5 was not.

sledgehammer999 commented 2 months ago

Qt 6 is Per-Monitor DPI Aware V2

https://doc.qt.io/qt-6/highdpi.html

Qt 5 was not.

We have officially dropped qt5 support.

sledgehammer999 commented 2 months ago

Of relevance to this issue:

It seems that 6.8 introduces a setter for the colorscheme to hint to the system the color mode an application wants. The system may not respect that. And it isn't clear from the docs if Windows will follow it. Link: https://doc-snapshots.qt.io/qt6-6.8/qstylehints.html#colorScheme-prop

xavier2k6 commented 2 months ago

Qt are always changing what they are doing/don't fully document changed behaviour etc...

look at what was happening to qBittorrent in earlier Qt 6.5 dark "app" mode support with accent color & I believe, it's changed again now.......talking about Windows here.

vivadavid commented 2 months ago

Thanks, @xavier2k6 : editing the config file worked for me. If light mode can be forced this way, is there a chance the feature can be accessed via the settings of the programme in a future release?

xavier2k6 commented 2 months ago

is there a chance the feature can be accessed via the settings of the programme in a future release?

I'm not sure the config file can be edited during runtime but no doubt there'll be another solution provided in near future.

vivadavid commented 2 months ago

is there a chance the feature can be accessed via the settings of the programme in a future release?

I'm not sure the config file can be edited during runtime but no doubt there'll be another solution provided in near future.

I keep my fingers crossed! :-)

SkiFire13 commented 2 months ago

Launch qbittorrent.exe like this: <path-to-qbt>/qbittorrent.exe -style WindowsVista

Is there a way to set this on autostart (hopefully in a way that's persistent after upgrades) and that doesn't require to set a global environment variable (i.e. QT_STYLE_OVERRIDE) that affects all Qt programs?

masterrite commented 2 months ago

I'm aghast at how arrogant the reply for this request is. Users have the right to choose which mode to use without going through hoops/changing system settings/requesting new "features" to switch.

qBittUser commented 2 months ago

@masterrite

This project is supported by volunteers, do not expect "customer support"-style interaction.

Be patient. The development team is small and resource limited. Developers and contributors take from their free time to analyze the problem and fix the issue.

Harsh words or threats won't help your situation. Your complaint will (very likely) be ignored.

Copied it from here: https://github.com/qbittorrent/qBittorrent/blob/master/CONTRIBUTING.md#bug-reporting-etiquette

Users have the right to choose which mode to use...

Users have the right to reinstall old version and postpone updating if they are happy with whatever they previously had installed, yet many still request getting automatic updates.

...without going through hoops/changing system settings/requesting new "features" to switch.

Contributors aren't mind readers. Volunteers and team members have the right to choose how to spend their free time and in what order they try to get bugfixes, extra features and options added.

Many users constantly requested dark mode to GUI and webUI.

Users had plenty of time to help test unstable v5.0.0 builds, to request more options and to give feedback or share a very good reason to postpone next release, yet complaints before where more about when exactly will v5 stable with dark mode be released.

So have to be patient and hope someone figures out how to add more built-in options, if that's what you want.

zwei7 commented 2 months ago

This thread exists because whoever implemented dark mode does not know how to do it well and assumed turning white into black was all they needed to do. It is more nuanced than that in UX design.

I got a 49" TV/monitor (Sony XBR49X900F) that has 100% sRGB color space and a SDR brightness of 577-962 nits so it is pretty capable and enlarges the text to be quite large and readable. and I sit 2 feet away from it. I find dark mode very hard to use. However many people have laptops with 72-75% sRGB color spaces with only 300 nits brightness and on a 13" screen. They must be suffering. Whoever chose the the text colors in the torrent list did not make any, or too few, adjustments for a good dark mode.

If you want to build a dark mode app you generally make the dark areas really dark, not grey, and the text pretty damn bright. Think High contrast. Then you got to make the text slightly thicker typeface/font and ensure the text colors do not "vibrate" with the dark background. There are websites to find clashing vibrating colors where they are too similar in hue and brightness and melt into each other. The green, blue, and purple text of the torrent list is too dark and blends in with the dark background. As a person who took a typography course from Lynda.com this is what I learned. I don't know everything, but I know that.

One reason everyone wants light/dark mode switching is because the text contrast is too low in dark mode.

Thank you for volunteering to make qbittorrent great for free.

grimson73 commented 1 month ago

Just chiming in but I really wanted to try or get used to the 'new' interface but went defeated for ' -style WindowsVista' after searching for in application options. Of course very thankful for the development of this program and i do feel no entitlement at all but I hope there will be a 'better' or native choice of several interfaces. Thanks! :)

vivadavid commented 1 month ago

Just chiming in but I really wanted to try or get used to the 'new' interface but went defeated for ' -style WindowsVista' after searching for in application options. Of course very thankful for the development of this program and i do feel no entitlement at all but I hope there will be a 'better' or native choice of several interfaces. Thanks! :)

Hi, could you please explain where and how to add the parameter?

grimson73 commented 1 month ago

Just chiming in but I really wanted to try or get used to the 'new' interface but went defeated for ' -style WindowsVista' after searching for in application options. Of course very thankful for the development of this program and i do feel no entitlement at all but I hope there will be a 'better' or native choice of several interfaces. Thanks! :)

Hi, could you please explain where and how to add the parameter?

image

You can change the properties of the shortcut to qBittorrent. Add the line next to the executable. Shutdown qBittorrent and start again with this shortcut.

vivadavid commented 1 month ago

Thanks, @grimson73 . I had already tried this, but I keep getting an error message. I've tried with no quotations and with quotations, but unsuccesfully in both cases.

error_message

vivadavid commented 1 month ago

OK, I found out what I was doing wrong: everything has to be between quotation marks, except the parameter:

Target: "C:\Program Files\qBittorrent\qbittorrent.exe" -style WindowsVista Start in: "C:\Program Files\qBittorrent"

I was confused with the use of the quotation marks, as I don't often play with parameters. In fact, the only programme where I have parameters is ExifTool and, for some reason, there are no quotation marks there.

In any case, I presume that adding -style WindowsVista' only affects the colours of the interface, right?

xavier2k6 commented 1 month ago

This thread exists because whoever implemented dark mode does not know how to do it well and assumed turning white into black was all they needed to do

We rely on Qt to provide the dark "app" mode support.

Kobi-Blade commented 1 month ago

This thread exists because whoever implemented dark mode does not know how to do it well and assumed turning white into black was all they needed to do

We rely on Qt to provide the dark "app" mode support.

I am quite concerned with that response, as Qt does not enforce specific colors for Dark Mode, nor does it mandate the use of either mode. This indicates that the implementation and testing may have been inadequate.

@zwei7 offered solid and helpful advice to improve your implementation, is rude to dismiss it outright.

Every piece of software should offer users the option to choose their preferred theme. Implementing this feature is straightforward, as demonstrated by the following code example:

#include <QApplication>
#include <QSettings>
#include <QStyleFactory>

void applyTheme(const QString &theme) {
    if (theme == "dark") {
        qApp->setStyle(QStyleFactory::create("Fusion"));
        QPalette darkPalette;
        darkPalette.setColor(QPalette::Window, QColor(53, 53, 53));
        darkPalette.setColor(QPalette::WindowText, Qt::white);
        qApp->setPalette(darkPalette);
    } else if (theme == "light") {
        qApp->setStyle(QStyleFactory::create("Fusion"));
        qApp->setPalette(qApp->style()->standardPalette());
    } else {
        qApp->setStyle(QStyleFactory::create("Fusion"));
        qApp->setPalette(qApp->style()->standardPalette());
    }
}

int main(int argc, char *argv[]) {
    QApplication app(argc, argv);

    QSettings settings("YourCompany", "YourApp");
    QString theme = settings.value("theme", "system").toString();
    applyTheme(theme);

    return app.exec();
}

Please note that the above code is a basic snippet and is not intended for qBittorrent usage.

xavier2k6 commented 1 month ago

I am quite concerned with that response, as Qt does not enforce specific colors for Dark Mode,

To a degree, they do:

When we read the dark system palette on Windows, then we use the theme's accent color for the QPalette::Highlight color role. This is however not quite correct, as the Accent is used in other places as well, and some controls use different colors (i.e. on Windows 11's "red" dark theme, the highlight is bright red, while the focus frames are in a paler orange). QPalette doesn't have an Accent color role right now, and adding that is a bit complex as the internal QPalette data structures need to change quite a bit once we go above 21 color roles - and we are at 21 already.

https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5#:~:text=When%20we%20read%20the%20dark%20system%20palette%20on%20Windows,%20then%20we%20use%20the%20theme's%20accent%20color%20for%20the%20QPalette::Highlight%20color%20role.

@zwei7 offered solid and helpful advice to improve your implementation, is rude to dismiss it outright.

I never dismissed anyone's suggestion or comment outright!, in fact there are some valid point IMHO but they've come up before & didn't progress due to difference of opinion etc.

@zwei7 If I came across as rude or you were offended in anyway, then I apologize - it was not my intention.

This indicates that the implementation and testing may have been inadequate.

Well, we are volunteers & there have been beta's/RC for user testing/feedback but nobody seemed really interested & only when official came out - started to provide both constructive & negative feedback.


There was numerous requests for a dark mode/auto switching......that was what was provided, now some users want qBittorrent to remain acting as light "app" mode irrespective of windows settings etc.

Some alternatives/workarounds have been provided.

Will we change the auto switch to dark "app mode/provide a user an option to change default style, easier option to opt-in/opt-out...it's seems more than likely, yes.

Will it be in a 5.0.1 release for example, I can't commit to that.

Is qBittorrent aesthetically perfect?! No, is it ok/tolerable etc. well that's up for debate/user perspective etc.

qBittUser commented 1 month ago

@vivadavid

In any case, I presume that adding -style WindowsVista' only affects the colours of the interface, right?

Presuming is not a good habit. It affects a lot of things in the interface. One old comparison example is here: https://github.com/qbittorrent/qBittorrent/issues/17081#issuecomment-1567470921

qBittUser commented 1 month ago

Would it be difficult to add one extra checkmark option to Windows NSIS qBittorrent setup file to either enable or disable automatic Dark Mode?

Maybe it's most obviously noticable place and quickest way to calm down some users who still prefer old look and who dislike being forced to use workarounds?

Kobi-Blade commented 1 month ago

Would it be difficult to add one extra checkmark option to Windows NSIS qBittorrent setup file to either enable or disable automatic Dark Mode?

Maybe it's most obviously noticable place and quickest way to calm down some users who still prefer old look and who dislike being forced to use workarounds?

No, this can and should be handled in the UI, not during Setup.

xavier2k6 commented 1 month ago

Of relevance to this issue:

It seems that 6.8 introduces a setter for the colorscheme to hint to the system the color mode an application wants. The system may not respect that. And it isn't clear from the docs if Windows will follow it. Link: https://doc-snapshots.qt.io/qt6-6.8/qstylehints.html#colorScheme-prop

@sledgehammer999 FYI:

Applications developed with Qt 6.8 can now explicitly request a color scheme to override the system setting with an explicit Dark or Light appearance:

https://www.qt.io/blog/qt-6.8-released#:~:text=Qt%20GUI

Qt 6.8.0 has been officially released now.

Rycochet commented 1 month ago

This seems to be the most active ticket for the issue, especially given the workaround - however is there a way to actually fix it in the webui? Both my OS and browser are Light Mode, but it's using the very broken theme with alternating lines where the dark background and medium grey text is near unreadable -

image

From the looks of things it's because of running in an iframe (using Organizr as well as SSO for security) as standalone works - so the mode detection itself seems potentially broken, although I'm not sure how the theming has been implemented as there are several ways to do it etc

xavier2k6 commented 1 month ago

@Rycochet trying clearing cache, turning off alternating row colors as temporary workaround.

Rycochet commented 1 month ago

@xavier2k6 There's no cache, and I've not seen any option to change that?

akarabach commented 1 month ago

any way to change theme to white for the WEB version ?

xavier2k6 commented 1 month ago

There's no cache

I meant clear your browser cache.

I've not seen any option to change that?

any way to change theme to white for the WEB version ?

@Rycochet @akarabach Coming in next version

Rycochet commented 1 month ago

There's no cache

I meant clear your browser cache.

There is no browser cache (web developer so I disable the cache entirely when the devtools are open - such as when investigating this lol)

I've not seen any option to change that? (alternating row colours) any way to change theme to white for the WEB version ?

Coming in next version

Perfect, thank you!

HanabishiRecca commented 1 month ago

There is no browser cache

Also ensure that no style altering extensions (like Dark Reader) are active for the page. Possibly try with a clean browser profile / another browser.

iPaulis commented 1 month ago

I used the qt.conf method to disable qBittorrent's dark app mode when it updated to version 5.0.0 a couple of weeks ago. However, after the recent update to version 5.0.1, dark mode has reactivated automatically.

We need a straightforward option that lets users select their preferred mode, rather than having qBittorrent decide for us.

Pentaphon commented 1 month ago

We need a straightforward option that lets users select their preferred mode, rather than having qBittorrent decide for us.

If you have Dark Mode selected on Windows, you can select the Windowsvista Qt style to get the light theme in 5.0.1

qBittUser commented 1 month ago

@iPaulis

If you're impatient, then start using development nightly builds or fork it in GitHub to fit your needs to prematurely get qBittorrent with more features.

Otherwise you might need to wait for official v5.1+ release to have more UI related built-in options.

If lucky, then Color scheme option will get backported to v5.0+, until then, if you do use v5.0.1, then quickest way to override automatic OS native dark mode theme support is to open qBittorrent - Tools - Options and select interface style to be windowsvista instead of anything else, apply, exit and reopen qBittorrent to have it look more like qBittorrent v4.6+.

000

000

masterrite commented 4 weeks ago

Harsh words or threats won't help your situation. Your complaint will (very likely) be ignored.

@qBittUser Right back at you. Is any part of my comment not factual? What did I threaten anyone with? Where was I harsh? Care to check your own responses? You rudely tell me to be patient and threatens to ignore "my complaints". I expressed my concerns, and you interpreted it as me wishing for "customer support-level response". A respectful reply in issues is called "basic decency". Arrogance doesn't help you. I seriously wonder what your responses would be had I said "the new update is shit", or straight up say devs are stupid instead.

The update is missing an important choice for basic user experience. I cannot fathom why it was a decision to exclude a choice that's default in other Qt programs during development. As a user, I do have the choice to postpone an upgrade, but that's my choice, not an excuse for devs. Users also reserve the right to criticize, and my words are hardly out of the line. Stop dramatizing the situation, and don't postpone adding the choice for other user on the account of you alone somehow finding my comment "harsh and threatening". It's quite funny how you don't like your own medicine