Bug 433256 - Disabled ToolButton actions/buttons don't render their text as disabled
Summary: Disabled ToolButton actions/buttons don't render their text as disabled
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.84.0
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: Marco Martin
URL:
Keywords:
: 438772 440799 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-19 15:50 UTC by Aleix Pol
Modified: 2024-09-25 19:09 UTC (History)
9 users (show)

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


Attachments
wrong qqc2-desktop (47.93 KB, image/png)
2021-02-19 15:50 UTC, Aleix Pol
Details
material (54.55 KB, image/png)
2021-02-19 15:50 UTC, Aleix Pol
Details
properly disabled (5.31 KB, image/png)
2021-02-22 10:47 UTC, Marco Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aleix Pol 2021-02-19 15:50:21 UTC
While debugging this I found that buttons' labels don't change the font colour.
https://bugs.kde.org/show_bug.cgi?id=433002

It works fine with material and org.kde.breeze, so the issue is here.

I'll upload screenshots so you can see how I test it.
Comment 1 Aleix Pol 2021-02-19 15:50:39 UTC
Created attachment 135906 [details]
wrong qqc2-desktop
Comment 2 Aleix Pol 2021-02-19 15:50:56 UTC
Created attachment 135907 [details]
material
Comment 3 Marco Martin 2021-02-22 10:47:59 UTC
Created attachment 136040 [details]
properly disabled

Does that still happen? on a minimal test case there's how a disabled toolbutton looks here
Comment 4 Noah Davis 2021-02-22 17:27:07 UTC
I think this might be an issue specific to Kirigami ActionToolBar. In the Discover screenshots, the "Make default" button is being created from a Kirigami Action that is a child of an ActionToolBar.

https://invent.kde.org/plasma/discover/-/blob/master/discover/qml/SourcesPage.qml#L45

I've had trouble with buttons generated by ActionToolBar not having their colors set correctly before (e.g., https://bugs.kde.org/show_bug.cgi?id=429972).
Comment 5 Marco Martin 2021-02-23 10:30:30 UTC
I can't reproduce with an actiontoolbar with same code as discover.
i would guess it ight be the binding between enabled of action to enabled of button being broken on some occasions
Comment 6 Nate Graham 2021-03-18 17:57:14 UTC
Yes, the way Discover injects actions into its ActionToolbar could be be the problem, causing broken bindings as Marco suggests. I can't reproduce the issuer with a generic disabled QQC2 toolbutton styled with the qqc2-desktop style. Moving to Discover
Comment 7 Aleix Pol 2021-03-22 16:22:39 UTC
It might be a problem of how Discover does it, but I don't see how we're really breaking any rules in there. So I can try other ways of doing it in Discover but ultimately the problem will eventually arise in other Kirigami apps if we don't understand it properly.
Comment 8 Nate Graham 2021-04-15 19:54:25 UTC
I think this is actually an ActionToolbar problem. You can see the issue in Kirigami Gallery too: Go to the ActionToolBar page, click on the info button in the top-right corner, and see that the text "HIG" at the bottom of the popup is rendered as active, even though it's disabled.
Comment 9 Nate Graham 2021-06-17 18:36:30 UTC
*** Bug 438772 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2021-08-10 20:34:27 UTC
According to Bug 440799, this affects plain toolbars too, so not a Kirigami issue. Moving.
Comment 11 Nate Graham 2021-08-10 20:35:11 UTC
*** Bug 440799 has been marked as a duplicate of this bug. ***
Comment 12 Marco Martin 2024-09-18 13:23:57 UTC
it's a problem in Kirigami.Theme:

* a Theme instance has its own set of colors if it does *not* inherit
* the set of color of disabled stuff should be different from enabled
* if a non inherit one is disabled, it will take colors from the parents that are not disabled

seems that the optimizations in theme can't really be made working correctly
Comment 13 Bug Janitor Service 2024-09-18 14:37:02 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/1614
Comment 14 Marco Martin 2024-09-25 09:37:19 UTC
Git commit bf3b2d41708e6331ed26aa280609b8f39f3f7772 by Marco Martin.
Committed on 25/09/2024 at 09:37.
Pushed by mart into branch 'master'.

Use disabled text colors also for inherit-ing Theme instances

* a Theme instance has its own set of colors if it does *not* inherit
* the set of color of disabled stuff should be different from enabled
* if a non inherit one is disabled, it will take colors from the parents that are not disabled

Change to behave as non inherit when the quickitem of this theme is disabled and
colorGroup is not Disabled

M  +50   -0    autotests/tst_theme.qml
M  +3    -0    src/platform/basictheme.cpp
M  +11   -2    src/platform/platformtheme.cpp

https://invent.kde.org/frameworks/kirigami/-/commit/bf3b2d41708e6331ed26aa280609b8f39f3f7772