aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/RoundButton.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-04-12 14:33:28 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-04-18 15:57:43 +0000
commit1641266caf6d689040aa66718a0b012b3124dbd4 (patch)
tree71967a265ab9e4fac46accc51edd8f4eec5ee594 /src/imports/controls/RoundButton.qml
parent9fc3659a678e6d1bd6b2514486bde1d1725963da (diff)
RoundButton: add support for icons
Task-number: QTBUG-49820 Change-Id: I3509ed64434ccb669362a17a301d2ea53138ee9b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/imports/controls/RoundButton.qml')
-rw-r--r--src/imports/controls/RoundButton.qml21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/imports/controls/RoundButton.qml b/src/imports/controls/RoundButton.qml
index ec6db731..f6304961 100644
--- a/src/imports/controls/RoundButton.qml
+++ b/src/imports/controls/RoundButton.qml
@@ -49,16 +49,25 @@ T.RoundButton {
baselineOffset: contentItem.y + contentItem.baselineOffset
padding: 6
+ spacing: 6
+
+ icon.width: 24
+ icon.height: 24
+ icon.color: enabled ? undefined : Default.textDisabledLightColor
//! [contentItem]
- contentItem: Text {
+ contentItem: IconLabel {
+ spacing: control.spacing
+ mirrored: control.mirrored
+ display: control.display
+
+ icon: control.icon
text: control.text
font: control.font
- opacity: enabled || control.highlighted || control.checked ? 1 : 0.3
- color: control.checked || control.highlighted ? Default.textLightColor : (control.visualFocus ? Default.focusColor : (control.down ? Default.textDarkColor : Default.textColor))
- horizontalAlignment: Text.AlignHCenter
- verticalAlignment: Text.AlignVCenter
- elide: Text.ElideRight
+ color: Color.transparent(control.checked || control.highlighted ? Default.textLightColor
+ : control.visualFocus ? Default.focusColor
+ : control.down ? Default.textDarkColor : Default.textColor,
+ enabled || control.highlighted || control.checked ? 1 : 0.3)
}
//! [contentItem]