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 Fusion style on Windows 10+ #19051

Merged
merged 1 commit into from
Sep 18, 2023
Merged

Use Fusion style on Windows 10+ #19051

merged 1 commit into from
Sep 18, 2023

Conversation

glassez
Copy link
Member

@glassez glassez commented May 31, 2023

No description provided.

@glassez glassez added the GUI GUI-related issues/changes label May 31, 2023
@glassez glassez added this to the 4.6.0 milestone May 31, 2023
@xavier2k6
Copy link
Member

Preliminary testing, all seems ok & fusion style is applied without any requirement of commands.

@glassez glassez requested review from a team June 1, 2023 07:10
@glassez glassez marked this pull request as ready for review June 1, 2023 07:10
xavier2k6
xavier2k6 previously approved these changes Jun 1, 2023
@sledgehammer999
Copy link
Member

Why isn't there any kind of explanation/justification* in the description for this change?
Also doesn't this mean that we lose the native look on Windows?

*I know that this has something to do with Qt 6.5 but a fuller explanation is needed for the choice.

@glassez
Copy link
Member Author

glassez commented Jun 1, 2023

Why isn't there any kind of explanation/justification* in the description for this change?

Oops... Related issues have been touched upon in various topics for a long time, so I felt too "merged" with its existence. Thank @xavier2k6 for summarizing it here.

@sledgehammer999
Copy link
Member

sledgehammer999 commented Jun 1, 2023

Qt have been recommending/suggesting the use of fusion since Qt 5.12 for High DPI Support

FYI, this is true only for Qt5. The Qt6 docs don't have this recommendation. IIRC one of the key aspects of Qt6 was that it had far better High DPI Support compared to Qt5.

Moreover, I don't think it is appropriate to stop supporting native look on Windows.
Maybe either wait for Qt6 to add proper dark mode to the native style, or make it a config option ("Follow system's dark mode").

@xavier2k6
Copy link
Member

xavier2k6 commented Jun 1, 2023

wait for Qt6 to add proper dark mode to the native style

They aren't going to do that IMO

We are not changing the default style in Qt on Windows, so by default, your application will use the Windows Vista style, which will use the light system palette even on a Windows 11 system running with a dark theme. The window framing will be consistent with the application palette.

But now applications can easily enable dark mode support, while respecting the user's preferences for their personal color scheme: you only have to set a style that works.

https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5#:~:text=We%20are%20not%20changing%20the%20default%20style%20in%20Qt%20on%20Windows

Windows: Enable dark mode system palette by default
Qt applications that use a style that supports dark mode rendering
(such as the classic Windows or Fusion styles) will respect the dark
appearance setting on Windows. Applications that use the Vista style,
which doesn't support rendering in dark mode, will use the light system
palette. On dark mode systems, the window frame will be dark if the
palette is dark.

https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.5.0/release-note.md

The Qt6 docs don't have this recommendation.

But they are recommending it as I pointed out in #19051 (comment) (at least for proper dark mode support)

The Fusion style is our preferred style for Windows 11. It looks good with dark and light palette

https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5#:~:text=The%20Fusion%20style%20is%20our%20preferred%20style%20for%20Windows%2011.%20It%20looks%20good%20with%20dark%20and%20light%20palette

@glassez
Copy link
Member Author

glassez commented Jun 1, 2023

@sledgehammer999

The UxTheme API is still present on Windows 11, and Qt still uses it to render the elements of user interface controls in the native Windows Vista style. However, the control assets we get are still based on the Aero design system of Windows Vista.

So it isn't fully "native" to latest Windows versions.
I doubt that there is any application about which it can be argued that it looks completely native in the latest versions of Windows. Even system applications cannot boast of this:

In recent years, Microsoft has moved towards the Fluent design system, which the Windows 11 system UI is based on. However, that system is not available through UxTheme, and so it is perhaps not a surprise that on a Windows 11 system, even the operating system UI comes in a mix of styles. Applications and system dialogs not written with the relatively new WinUI library don't look "fluent", often don't support the dark color scheme, and some control panels deeper down in the tree still look like they used to with Windows 2000.

In addition, qBittorrent itself has quite a lot of custom elements in its design.
To be honest, since I've been experimenting with Fusion style, I often can't recognize if it's enabled at the moment.

@glassez
Copy link
Member Author

glassez commented Jun 1, 2023

@xavier2k6
If @sledgehammer999 remains adamant, we can add an option to enable Fusion style (or just recommend users to do it using environment variable or command line). Unfortunately, this will somewhat complicate the further improvement of support for the Dark Mode, which is becoming increasingly popular with users.

@xavier2k6
Copy link
Member

xavier2k6 commented Jun 1, 2023

we can add an option to enable Fusion style

Another option would be to allow it as default & add an option to disable/revert to Vista style?! (Although, honestly - I don't see the point but that's just my opinion)

(or just recommend users to do it using environment variable or command line).

We've been doing that or at least I have countless times..... & we sill still have users asking can it be enabled through config file etc. -> #17081 (comment)

Unfortunately, this will somewhat complicate the further improvement of support for the Dark Mode, which is becoming increasingly popular with users.

Totally agree!

TBH - I think there's just too many benefits to go with Fusion style as default than leave it as is.....we would be able to close numerous tickets too.

@sledgehammer999
Copy link
Member

Let's wait a couple of days for other people input regarding native look (or not).

@glassez
Copy link
Member Author

glassez commented Jun 1, 2023

Let's wait a couple of days for other people input regarding native look (or not).

I would produce a beta release with it and explicitly mentioned it on the news page (with an indication of its supposed advantages and possible disadvantages). Then it would be more likely to get feedback from a slightly wider range of users. But I'm not rushing to merge it anyway.

@glassez
Copy link
Member Author

glassez commented Jun 2, 2023

Therefore, I ask you guys to please keep the native theme as an option, even if not as default. Please.

It affects only the style used by default. You can still override it using QT_STYLE_OVERRIDE=WindowsVista environment variable or -style WindowsVista command line parameter.

@sledgehammer999
Copy link
Member

There doesn't seem to be any new discussion here.
And as far as I can tell, nothing new from the Qt side.

@glassez it's your choice if you want to merge it and let it be tested for the next beta release. Or wait for any Qt progress on the matter. We can stick to 6.4.x for the time being.

@glassez
Copy link
Member Author

glassez commented Jun 19, 2023

Or wait for any Qt progress on the matter. We can stick to 6.4.x for the time being.

This PR isn't restricted Qt version to be at least 6.5. Anyway we should stick to 6.4.x on Windows until "crash on exit" issue is fixed.

@glassez glassez requested review from sledgehammer999 and a team and removed request for a team June 19, 2023 05:39
xavier2k6
xavier2k6 previously approved these changes Jun 19, 2023
@glassez glassez removed this from the 4.6.0 milestone Jul 7, 2023
@xavier2k6
Copy link
Member

I think it would be a good idea to have this in the next public beta release?!

@glassez
Copy link
Member Author

glassez commented Jul 15, 2023

I think it would be a good idea to have this in the next public beta release?!

I decided to postpone it for now. Moreover, we cannot yet get all the benefits from using Qt 6.5, along the way without introducing a lot of its regressions and shortcomings.

@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the Stale label Sep 14, 2023
@glassez glassez removed the Stale label Sep 14, 2023
@glassez
Copy link
Member Author

glassez commented Sep 15, 2023

PR is rebased to resolve merge conflicts.

@glassez glassez requested a review from a team September 15, 2023 17:23
@glassez glassez added this to the 5.0 milestone Sep 15, 2023
@xavier2k6
Copy link
Member

Re-tested. 👍

@glassez
Copy link
Member Author

glassez commented Sep 16, 2023

Now I intend to merge it in master so that it has more time to be tested (at least by a small number of users that use alpha builds).

@xavier2k6

This comment was marked as off-topic.

@glassez glassez merged commit 5a33417 into qbittorrent:master Sep 18, 2023
13 checks passed
@glassez glassez deleted the fusion branch September 18, 2023 05:38
@stalkerok
Copy link
Contributor

There is problem:
Add torrent
Highlight torrent
Click General tab
Color of task changes to black
2023-09-18_192700

Highlight torrent
Click on empty space in transfer list
Click General tab
Color of task remains same as it should be
2023-09-18_192746

@xavier2k6
Copy link
Member

@stalkerok This has nothing to do with the fusion style PR, it's a caveat of Qt 6.5 series........change your accent color & see what happens....you should also see a change in row color

@stalkerok
Copy link
Contributor

I noticed it after this PR, if this is normal behavior then ok. But I don't think this behavior is normal...
2023-09-18_201142
2023-09-18_201216
Anyway, I had to report it.

@Pentaphon
Copy link

it's a caveat of Qt 6.5 series........change your accent color & see what happens....you should also see a change in row color

What about 6.6.1?

@xavier2k6
Copy link
Member

What about 6.6.1?

It still happens there as it's a change in Qt's theme handling behavior......we will have to adapt/make necessary changes.

The highlight bar was changed many moons ago I believe for the WebUI to a fixed color/not follow system etc., similar may have to be done going forward for GUI too.

As it stands....issues that were brought up when we were changing icon colors etc. (like not being able to see icon when highlighted) are now again an issue depending on accent color.

So, you can see why it's not so easy to make certain aesthetic changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI GUI-related issues/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants