diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-04-16 18:37:09 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-04-18 14:11:31 +0000 |
commit | b9c3f6b95e116354acc3f70c0811f4d2f4c68afe (patch) | |
tree | 3331ce65de4436f0f4ff98a7ae514efc18bc17eb /src/imports/controls/universal/Button.qml | |
parent | 392d520ade77e6fb941e54fdaa8b23d34c745a8b (diff) |
Universal: add foreground and background attached properties
Same as b51e520f for Material.
This has been a common request on the mailing lists and forums. Users
want to customize the text color of various controls without having to
replace whole delegates. This change makes it possible to specify both
foreground (eg. Button text) and background (eg. ApplicationWindow,
Page and Pane background) colors so that they propagate to children in
the same way than accent and theme do.
Change-Id: I55084c58f0c62e8088b270ed98437241e382ca15
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/universal/Button.qml')
-rw-r--r-- | src/imports/controls/universal/Button.qml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/imports/controls/universal/Button.qml b/src/imports/controls/universal/Button.qml index d0dbcf99..0741812d 100644 --- a/src/imports/controls/universal/Button.qml +++ b/src/imports/controls/universal/Button.qml @@ -62,7 +62,8 @@ T.Button { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - color: !control.enabled ? control.Universal.baseLowColor : control.Universal.baseHighColor + opacity: enabled ? 1.0 : 0.2 + color: control.Universal.foreground } //! [contentItem] |