Bug 488620 - Desktop and Breeze QQC2 styles misuse icon.name and icon.source properties
Summary: Desktop and Breeze QQC2 styles misuse icon.name and icon.source properties
Status: CONFIRMED
Alias: None
Product: frameworks-qqc2-desktop-style
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-17 14:32 UTC by Jack Hill
Modified: 2024-08-11 11:42 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Hill 2024-06-17 14:32:40 UTC
SUMMARY
The Qt Quick Controls icon documentation states:

https://doc.qt.io/qt-6/qtquickcontrols-icons.html

> Theme icons are referenced by a name, and regular icons by a source URL.
> Both icon.name and icon.source can be set to ensure that an icon will always
> be found. If the icon is found in the theme, it will always be used; even if
> icon.source is also set. If the icon is not found in the theme, icon.source
> will be used instead.

but this is not the case when running with Desktop or Breeze style. Instead icon.name and icon.source can take either an icon name or URL, and icon.name is given a higher priority. This means I can do `icon.name: "image://MyProvider/cool-icon"` or `icon.source: "media-playback-start"` get an icon.

The issue is that this does not match the behavior of upstream styles, so developers who accidentally use the wrong property will unknowingly break the app when running with other styles.

STEPS TO REPRODUCE
1. Build Elisa at commit ffc7a58b (latest master)
2. Run in desktop mode with Desktop style
3. Open application menu
4. Open color scheme menu

5. Close Elisa & launch again but with Material style enabled
6. Re-open color scheme menu

OBSERVED RESULT
With Desktop style: color scheme icons are shown
With Material style: no color scheme icons are shown

EXPECTED RESULT
With both styles: no color scheme icons are shown

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240609
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.3-1-default (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-06-17 18:50:38 UTC
This seems like the sort of thing where if we correct it, we break our own apps. :(
Comment 2 Nate Graham 2024-06-17 18:51:07 UTC
In the meantime, we should definitely fix incorrect usages in our own apps to ease that burden should we decide to make a change in the frameworks.
Comment 3 Nate Graham 2024-06-17 18:52:48 UTC
Another awkward element here is that Kirigami.Icon has only a source property, habituating people to using a property with "source" in it to pass an icon name rather than an image file or something.
Comment 4 Bug Janitor Service 2024-07-17 19:11:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/597
Comment 5 Nate Graham 2024-07-22 15:47:39 UTC
Git commit 5efadbd94ef26e2686fa32cfb17955ffb92c671d by Nate Graham, on behalf of Jack Hill.
Committed on 22/07/2024 at 15:47.
Pushed by ngraham into branch 'master'.

Fix missing color scheme icons with non-default QQC2 styles

M  +4    -1    src/qml/ApplicationMenu.qml
M  +2    -1    src/qml/SettingsForm.qml

https://invent.kde.org/multimedia/elisa/-/commit/5efadbd94ef26e2686fa32cfb17955ffb92c671d
Comment 6 Bug Janitor Service 2024-08-11 11:33:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/1605
Comment 7 Bug Janitor Service 2024-08-11 11:42:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/423