aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-09-28 08:09:13 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-09-28 13:11:29 +0000
commite981fd0b7ec239f093be2e88d157c564c4f59aa2 (patch)
tree976a674a47b3c486fb4db8512186d1373dcbe793
parentcf26976c32995ffc5988e770576d7b0c5b3d5ffc (diff)
Default: make RoundButton use palettes
Task-number: QTBUG-63369 Change-Id: I7d4b1f7f0ad0426a79b41534030b65774cd1b07f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/imports/controls/RoundButton.qml11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/imports/controls/RoundButton.qml b/src/imports/controls/RoundButton.qml
index 0704bf01..13ccddc5 100644
--- a/src/imports/controls/RoundButton.qml
+++ b/src/imports/controls/RoundButton.qml
@@ -54,8 +54,7 @@ T.RoundButton {
icon.width: 24
icon.height: 24
icon.color: control.checked || control.highlighted ? control.palette.brightText :
- control.visualFocus ? control.palette.highlight :
- control.flat && !control.down ? control.palette.windowText : control.palette.buttonText
+ control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText
contentItem: IconLabel {
spacing: control.spacing
@@ -66,8 +65,7 @@ T.RoundButton {
text: control.text
font: control.font
color: control.checked || control.highlighted ? control.palette.brightText :
- control.visualFocus ? control.palette.highlight :
- control.flat && !control.down ? control.palette.windowText : control.palette.buttonText
+ control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText
}
background: Rectangle {
@@ -76,9 +74,8 @@ T.RoundButton {
radius: control.radius
opacity: enabled ? 1 : 0.3
visible: !control.flat || control.down || control.checked || control.highlighted
- color: control.checked || control.highlighted ?
- (control.visualFocus ? (control.down ? Default.buttonCheckedFocusColor : control.palette.highlight) : (control.down ? Default.buttonCheckedPressedColor : Default.buttonCheckedColor)) :
- (control.visualFocus ? (control.down ? Default.focusPressedColor : Default.focusLightColor) : (control.down ? Default.buttonPressedColor : Default.buttonColor))
+ color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button,
+ control.palette.mid, control.down ? 0.5 : 0.0)
border.color: control.palette.highlight
border.width: control.visualFocus ? 2 : 0
}