Bug 156894 - kf5/qt6: Dark system themes don't automatically enable corresponding dark icon themes
Summary: kf5/qt6: Dark system themes don't automatically enable corresponding dark ico...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All Linux (All)
: high normal
Assignee: Michael Weghorn
URL:
Whiteboard: target:24.2.0
Keywords:
: 129504 135102 153618 (view as bug list)
Depends on: 148764
Blocks: KDE, KF5 Icon-Theme-Breeze Icon-Themes-Code Linux-Dark-Mode
  Show dependency treegraph
 
Reported: 2023-08-24 13:00 UTC by Heiko Tietze
Modified: 2024-01-16 09:01 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2023-08-24 13:00:58 UTC
Split from bug 127138. The corresponding icon theme should be picked depending on whether the appearance is light or dark.
Comment 1 Heiko Tietze 2023-08-24 13:02:02 UTC
*** Bug 129504 has been marked as a duplicate of this bug. ***
Comment 2 Heiko Tietze 2023-08-24 13:02:09 UTC
*** Bug 135102 has been marked as a duplicate of this bug. ***
Comment 3 Heiko Tietze 2023-08-24 13:02:13 UTC
*** Bug 153618 has been marked as a duplicate of this bug. ***
Comment 4 Heiko Tietze 2023-08-24 13:02:19 UTC
*** Bug 155906 has been marked as a duplicate of this bug. ***
Comment 5 Michael Weghorn 2023-09-02 08:15:58 UTC
Pending Gerrit change:
https://gerrit.libreoffice.org/c/core/+/156465

Quoting from the commit message for some more details on what already worked before and how it behaves now:

On my Debian testing, the Breeze dark icon theme is
now used as expected with kf5 or qt6 when setting
the Global KDE Plasma theme to "Breeze Dark" and
manually setting the Icon theme to "GNOME" afterwards.
Previously, this would not use a dark icon theme and
icons would be hard to see.

Without manually setting the icon theme to "GNOME",
the Breeze Dark icon theme would already be used
before, because selecting "Breeze Dark" as the
global KDE Plasma theme also selects the "Breeze Dark"
icon theme by default, and therefore "breeze-dark"
was already passed as the first param to
`StyleSettings::SetPreferredIconTheme` and since
that icon theme is present, the `bPreferDarkTheme`
wouldn't be evaluated at all; it's only used
when determining the fallback icon theme when
the specified icon theme is not present.

(Likewise, by enabling the "Breeze Dark" global theme
and then manually setting the icon theme to "Breeze"
in Plasma System settings, the Breeze light icon theme
will be used in LibreOffice as well, resulting in hard
to see icons, but I tend to think that that behavior is
correct and works as designed - it's a misconfiguration.)
Comment 6 Commit Notification 2023-09-02 13:42:53 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/73d0d205c43a9848acd313ff1845ebafe63e807c

tdf#156894 qt: Prefer dark icon theme in dark mode

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Heiko Tietze 2023-09-04 08:02:12 UTC
The Appearance frame is still hidden in Tools > Options > View.
Comment 8 Michael Weghorn 2023-09-04 09:15:44 UTC
(In reply to Heiko Tietze from comment #7)
> The Appearance frame is still hidden in Tools > Options > View.

True, but that's not what I understood this bug report to be about.
The bug description says:

Heiko Tietze in comment #0)
> Split from bug 127138. The corresponding icon theme should be picked
> depending on whether the appearance is light or dark.

This is the case in my understanding now.

Making it possible to set Light or Dark Mode in Tools -> Options -> View IMHO is something else, and from what I can see, there's no Qt API for that, but separate styles/themes are used to provide light/dark themes.

The `QStyleHints::colorScheme` docs [1] explicitly say: "[read-only, since 6.5]", so it's read only and can't be changed.

My take would be that this bug report here should be closed as FIXED, and if considered useful, a separate bug report should be created for *setting* the appearance.
(But from what I can see so far, I'd suggest to close such a one as NOTOURBUG, due to no relevant API being present... What might be possible is to add a way to configure any Qt style from within the app. I don't really think that's application's task but if you want a separate style for just one app, you can start it with QT_STYLE_OVERRIDE=somestylename set. Anyway, if really considered necessary, that might be possible.)

@Heiko: What do you think?

[1] https://doc.qt.io/qt-6/qstylehints.html#colorScheme-prop
Comment 9 Michael Weghorn 2023-09-04 10:02:14 UTC
(In reply to Michael Weghorn from comment #8)
> IMHO is something else, and from what I can see, there's no Qt API for that,
> but separate styles/themes are used to provide light/dark themes.

Or rather than separate styles, maybe there's yet a different configuration layer, as this is in a separate "Colours" tab in KDE Plasma system settings. But it probably doesn't change that there's no Qt API for switching between light and dark, but it's an "arbitrary" set of color schemes.
Comment 10 Heiko Tietze 2023-09-04 10:55:13 UTC
(In reply to Michael Weghorn from comment #8)
> there's no Qt API for that, but separate styles/themes...
> My take would be that this bug report here should be closed as FIXED...

Some confusion on my side. This is only about the icon-theme and not the appearance thing.
Comment 11 Edward Helms 2024-01-16 04:46:56 UTC Comment hidden (spam)