Every Control instance has a palette property. Make use of it if possible.
It allows developers to override certain controls' colors from the code.
Details
Details
- Reviewers
mart - Group Reviewers
Kirigami - Commits
- R858:b176593771c2: Use Control.palette
Ran Discover with it on Breeze and Breeze Dark. Made a button Blue
Diff Detail
Diff Detail
- Repository
- R858 Qt Quick Controls 2: Desktop Style
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
Comment Actions
to not break all custom kirigami color set, i think by default all controls in the desktop style should be binded to Kirigami.Theme.palette
or the colorset, complementary areas gets broken
plugin/kquickstyleitem.cpp | ||
---|---|---|
716 | it should check if that proeprty is valid and if managed to get an intelligible qpalette out of it |
plugin/kquickstyleitem.cpp | ||
---|---|---|
716 | In which case will it be a wrong palette? We are reading a Control property, it's not really optional. |
Comment Actions
Do you want patches like this on every component?
diff --git a/org.kde.desktop/Button.qml b/org.kde.desktop/Button.qml index 08a8f0e..2efbf9a 100644 --- a/org.kde.desktop/Button.qml +++ b/org.kde.desktop/Button.qml @@ -34,6 +34,8 @@ T.Button { hoverEnabled: true //Qt.styleHints.useHoverEffects TODO: how to make this work in 5.7? + palette: Kirigami.Theme.palette + contentItem: Item {} Kirigami.MnemonicData.enabled: controlRoot.enabled && controlRoot.visible Kirigami.MnemonicData.controlType: Kirigami.MnemonicData.ActionElement
plugin/kquickstyleitem.cpp | ||
---|---|---|
716 | m_control comes from any qquickitem, so it's not a given that will be a qqc2 control instance |