aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-22 14:50:24 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-02-22 16:52:21 +0000
commit119e43db9747ee070c84fc3ffb4c81ee4db35da8 (patch)
treedbd086267ed443ee86668449fd618a7bf49066a0 /src
parent08344012fce59dc50d18778acc9861c5e242ea09 (diff)
Material: add missing focus highlights
Change-Id: Id678a095a56f7494c9f32160326ba667a6c0dc28 Task-number: QTBUG-51257 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/material/Button.qml8
-rw-r--r--src/imports/controls/material/CheckBox.qml2
-rw-r--r--src/imports/controls/material/ComboBox.qml8
-rw-r--r--src/imports/controls/material/RadioButton.qml2
-rw-r--r--src/imports/controls/material/SliderHandle.qml10
-rw-r--r--src/imports/controls/material/Switch.qml2
6 files changed, 28 insertions, 4 deletions
diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml
index 77128861..a869c915 100644
--- a/src/imports/controls/material/Button.qml
+++ b/src/imports/controls/material/Button.qml
@@ -91,6 +91,14 @@ T.Button {
}
}
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ radius: parent.radius
+ visible: control.activeFocus
+ color: control.Material.checkBoxUncheckedRippleColor
+ }
+
layer.enabled: control.enabled
layer.effect: DropShadow {
verticalOffset: 1
diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml
index 5becfc5c..230f696f 100644
--- a/src/imports/controls/material/CheckBox.qml
+++ b/src/imports/controls/material/CheckBox.qml
@@ -87,7 +87,7 @@ T.CheckBox {
height: width
control: control
colored: control.checked
- opacity: control.pressed ? 1 : 0
+ opacity: control.pressed || control.activeFocus ? 1 : 0
}
// TODO: This needs to be transparent
diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml
index 7f47672e..1c293567 100644
--- a/src/imports/controls/material/ComboBox.qml
+++ b/src/imports/controls/material/ComboBox.qml
@@ -101,6 +101,14 @@ T.ComboBox {
opacity: !control.enabled ? 0.5 : 1.0
source: "qrc:/qt-project.org/imports/Qt/labs/controls/material/images/drop-indicator.png"
}
+
+ Rectangle {
+ width: parent.width
+ height: parent.height
+ radius: parent.radius
+ visible: control.activeFocus
+ color: control.Material.checkBoxUncheckedRippleColor
+ }
}
//! [background]
diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml
index 25d91a5c..f01d2dc9 100644
--- a/src/imports/controls/material/RadioButton.qml
+++ b/src/imports/controls/material/RadioButton.qml
@@ -72,7 +72,7 @@ T.RadioButton {
height: width
control: control
colored: control.checked
- opacity: control.pressed ? 1 : 0
+ opacity: control.pressed || control.activeFocus ? 1 : 0
}
Rectangle {
diff --git a/src/imports/controls/material/SliderHandle.qml b/src/imports/controls/material/SliderHandle.qml
index dc1a836d..6f54eaf5 100644
--- a/src/imports/controls/material/SliderHandle.qml
+++ b/src/imports/controls/material/SliderHandle.qml
@@ -55,7 +55,7 @@ Item {
height: parent.height
radius: width / 2
color: root.control.Material.accentColor
- scale: root.handlePressed || root.handleHasFocus ? 1.5 : 1
+ scale: root.handlePressed ? 1.5 : 1
Behavior on scale {
NumberAnimation {
@@ -63,4 +63,12 @@ Item {
}
}
}
+
+ Ripple {
+ width: parent.width
+ height: width
+ control: root.control
+ colored: true
+ opacity: root.handleHasFocus && !root.handlePressed ? 1 : 0
+ }
}
diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml
index f44fb31a..0b9edcab 100644
--- a/src/imports/controls/material/Switch.qml
+++ b/src/imports/controls/material/Switch.qml
@@ -68,7 +68,7 @@ T.Switch {
height: width
control: control
colored: control.checked
- opacity: control.pressed ? 1 : 0
+ opacity: control.pressed || control.activeFocus ? 1 : 0
}
Rectangle {