Bug 466437

Summary: Kirigami.Dialog has a workaround with particular Breeze qqc2-desktop-style implementation in mind
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: ratijas <me>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: REPORTED ---    
Severity: normal CC: notmart
Priority: NOR    
Version First Reported In: Master   
Target Milestone: Not decided   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: qqc2-desktop-style flat disabled ToolButton
KF6 qqc2-desktop-style flat disabled ToolButton

Description ratijas 2023-02-25 23:42:59 UTC
Created attachment 156734 [details]
qqc2-desktop-style flat disabled ToolButton

SUMMARY

The following code looks like a workaround for a styling issue in a particular QQC2 or, more specifically, qqc2-desktop-style implementation, namely Breeze:

> // add custom footer buttons
> Repeater {
>     model: root.customFooterActions
>     // we have to use Button instead of ToolButton, because ToolButton has no visual distinction when disabled
>     delegate: QQC2.Button {
>         flat: flatFooterButtons
>         action: modelData
>         visible: modelData.visible
>     }
> }

This kind of hacks are not suitable for core library components like Dialog. Besides, the dialog itself should have some sort of templates+styling split in two components like QQC2. Then, qqc2-desktop-style implementation of Kirigami templates could use any hacks which are appropriate for known bugs and limitations.

Actually, this is not even entirely true. The icon of a flat disabled ToolButton does change opacity. It's just the text that stays bright. However, the non-flat counterpart fades both text and icon; and the background too. It looks like a bug in qqc2-desktop-style bridge? Because in QtWidgets, if I set e.g. toolbar actions in Dolphin to display icons and text, then disabled Back/Forward flat toolbuttons are fading all at once -- not just icons.

STEPS TO REPRODUCE
1. Open Kirigami/Dialog.qml

OBSERVED RESULT
See workarounds.

EXPECTED RESULT
Upstream bug fixes.

SOFTWARE/OS VERSIONS
KDE Frameworks Version: git/master, git/kf5
Comment 1 ratijas 2023-02-25 23:49:18 UTC
Created attachment 156735 [details]
KF6 qqc2-desktop-style flat disabled ToolButton

Apparently, I was wrong about git/master part. Disabled flat tool button has both text and icon faded with KF6 qqc2-desktop-style / Breeze.

So the hack can be removed for KF6 on git master, I guess.