Bug 465054 - QtQuick Controls Button does not inherit from Kirigami.Theme when using Kirigami.Theme.inherit: true
Summary: QtQuick Controls Button does not inherit from Kirigami.Theme when using Kirig...
Status: REOPENED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-30 20:45 UTC by Thiago Sueto
Modified: 2023-03-27 19:13 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Kirigami.Theme.inherit example from Colors tutorial. (634 bytes, text/x-qml)
2023-01-30 20:45 UTC, Thiago Sueto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Sueto 2023-01-30 20:45:34 UTC
Created attachment 155800 [details]
Kirigami.Theme.inherit example from Colors tutorial.

When attempting to reproduce the example from https://develop.kde.org/docs/use/kirigami/style-colors/#color-set, it seems QQC2.Buttons don't inherit from Kirigami.Theme.

The code example is added as an attachment. It can be run with qmlscene.
Comment 1 Marco Martin 2023-02-01 11:35:52 UTC
reproduced, and there are 2 issues there:

* the inherit mechanism doesn't work up to ApplicationWindow but only between items
* things painted with qstyle appear to not be using the palette coming from Kirigami Theme, this was done in commit 939176f4a556ed38570db6e6735ba44a1015ea67 of qqc2-desktop-style in response to https://bugs.kde.org/show_bug.cgi?id=406295
Comment 2 Bug Janitor Service 2023-02-01 15:46:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/228
Comment 3 Marco Martin 2023-02-07 09:08:20 UTC
Git commit 55f5eb707b17d47bd3e776f803f1656ff5ff2e47 by Marco Martin.
Committed on 07/02/2023 at 09:06.
Pushed by mart into branch 'kf5'.

use again the palette coming from Kirigami.Theme

It's supposed to be possible to change "color set" of controls by
setting their inherit flag to false, but at some point that got broken
in commit 939176f4a556ed3 as a fix to bug 406295

but this caused bug 465054

bring partially back the palette binding, but for most controls, only
when inherit of their attached theme property is true (which is not
default) as the application of color is not perfect (this is due
to incompatibilities between QPalette api and the horrible KColorScheme
api, wonder if it can be corrected in kf6 to play a bit nicer)

checkboxes still not apply the palette, so there is no risk of 406295
happening again and in general by default everything doesn't look with
altered colors, but one has to "want" it by setting inherit

M  +1    -0    org.kde.desktop/Button.qml
M  +1    -0    org.kde.desktop/ComboBox.qml
M  +1    -0    org.kde.desktop/DelayButton.qml
M  +1    -0    org.kde.desktop/Dial.qml
M  +2    -0    org.kde.desktop/ProgressBar.qml
M  +1    -0    org.kde.desktop/RoundButton.qml
M  +2    -0    org.kde.desktop/ScrollBar.qml
M  +2    -0    org.kde.desktop/SpinBox.qml
M  +1    -0    org.kde.desktop/TabBar.qml
M  +4    -0    org.kde.desktop/TabButton.qml
M  +1    -0    org.kde.desktop/TextArea.qml
M  +1    -0    org.kde.desktop/TextField.qml
M  +1    -0    org.kde.desktop/ToolButton.qml
M  +1    -0    org.kde.desktop/ToolTip.qml

https://invent.kde.org/frameworks/qqc2-desktop-style/commit/55f5eb707b17d47bd3e776f803f1656ff5ff2e47
Comment 4 Marco Martin 2023-02-07 09:10:49 UTC
Git commit 03da9da594de0cbf2aa74b68c4a213b2755c5529 by Marco Martin.
Committed on 07/02/2023 at 09:10.
Pushed by mart into branch 'master'.

use again the palette coming from Kirigami.Theme

It's supposed to be possible to change "color set" of controls by
setting their inherit flag to false, but at some point that got broken
in commit 939176f4a556ed3 as a fix to bug 406295

but this caused bug 465054

bring partially back the palette binding, but for most controls, only
when inherit of their attached theme property is true (which is not
default) as the application of color is not perfect (this is due
to incompatibilities between QPalette api and the horrible KColorScheme
api, wonder if it can be corrected in kf6 to play a bit nicer)

checkboxes still not apply the palette, so there is no risk of 406295
happening again and in general by default everything doesn't look with
altered colors, but one has to "want" it by setting inherit

M  +1    -0    org.kde.desktop/Button.qml
M  +1    -0    org.kde.desktop/ComboBox.qml
M  +1    -0    org.kde.desktop/DelayButton.qml
M  +1    -0    org.kde.desktop/Dial.qml
M  +2    -0    org.kde.desktop/ProgressBar.qml
M  +1    -0    org.kde.desktop/RoundButton.qml
M  +2    -0    org.kde.desktop/ScrollBar.qml
M  +2    -0    org.kde.desktop/SpinBox.qml
M  +1    -0    org.kde.desktop/TabBar.qml
M  +4    -0    org.kde.desktop/TabButton.qml
M  +1    -0    org.kde.desktop/TextArea.qml
M  +1    -0    org.kde.desktop/TextField.qml
M  +1    -0    org.kde.desktop/ToolButton.qml
M  +1    -0    org.kde.desktop/ToolTip.qml

https://invent.kde.org/frameworks/qqc2-desktop-style/commit/03da9da594de0cbf2aa74b68c4a213b2755c5529
Comment 5 Bug Janitor Service 2023-02-17 09:26:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/232
Comment 6 ratijas 2023-02-17 09:32:32 UTC
Git commit 84f0a295b9aaa7c2b37e2b3f4677a7a5aee31818 by ivan tkachenko.
Committed on 17/02/2023 at 09:24.
Pushed by ratijas into branch 'master'.

Revert "use again the palette coming from Kirigami.Theme"

This reverts commit 03da9da594de0cbf2aa74b68c4a213b2755c5529.

It doesn't work in Qt6, because they broke import versions compatibility
for the palette property in, which was uplifted to QQuickItem and
marked as "since 6.0", even though it was available in controls since
QQC 2.3 (Qt 5.10). Simply removing import versions does not help
either, as the whole thing just crashes deep inside QtQuick runtime,
which is because they changed palette type from QPalette to QtQuick's
own private thing, and they somehow fail to covert between each other.

M  +0    -1    org.kde.desktop/Button.qml
M  +0    -1    org.kde.desktop/ComboBox.qml
M  +0    -1    org.kde.desktop/DelayButton.qml
M  +0    -1    org.kde.desktop/Dial.qml
M  +0    -2    org.kde.desktop/ProgressBar.qml
M  +0    -1    org.kde.desktop/RoundButton.qml
M  +0    -2    org.kde.desktop/ScrollBar.qml
M  +0    -2    org.kde.desktop/SpinBox.qml
M  +0    -1    org.kde.desktop/TabBar.qml
M  +0    -4    org.kde.desktop/TabButton.qml
M  +0    -1    org.kde.desktop/TextArea.qml
M  +0    -1    org.kde.desktop/TextField.qml
M  +0    -1    org.kde.desktop/ToolButton.qml
M  +0    -1    org.kde.desktop/ToolTip.qml

https://invent.kde.org/frameworks/qqc2-desktop-style/commit/84f0a295b9aaa7c2b37e2b3f4677a7a5aee31818
Comment 7 ratijas 2023-03-27 19:10:46 UTC
Git commit 3080f5edef27d19641da6ad9e0eabbe77ffa0f08 by ivan tkachenko.
Committed on 27/03/2023 at 19:00.
Pushed by ratijas into branch 'master'.

tests: Skip palette test

This is temporary, because Kirigami.Theme.palette is still broken in Qt6.

M  +1    -0    autotests/tst_theme.qml

https://invent.kde.org/frameworks/kirigami/commit/3080f5edef27d19641da6ad9e0eabbe77ffa0f08
Comment 8 ratijas 2023-03-27 19:13:58 UTC
Remember to un-skip the tests when re-applying the fix for KF6.

https://invent.kde.org/frameworks/kirigami/-/merge_requests/1005