aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-04-11 12:46:55 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-04-11 13:04:45 +0000
commite7b42b4de0d9148e53a245ffd4eb26338fd9f8dc (patch)
tree07b0ce7fc52ff61ee9dbdff1f45456ebe2875eca /src/imports/controls/material
parent8fd632c65e215925fed12e3b21ab98b77382e3ab (diff)
Use Control.activeKeyFocus instead of Item.activeFocus
This makes the controls visualize focus only when interacting with keys, so this basically allows us to set for example Qt.StrongFocus policy by default on buttons and friends. Change-Id: I6c81c58b7acfd2bc592bdd12d804e7e48ee65e95 Task-number: QTBUG-51796 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/material')
-rw-r--r--src/imports/controls/material/Button.qml4
-rw-r--r--src/imports/controls/material/CheckBox.qml2
-rw-r--r--src/imports/controls/material/ComboBox.qml2
-rw-r--r--src/imports/controls/material/RadioButton.qml2
-rw-r--r--src/imports/controls/material/Slider.qml2
-rw-r--r--src/imports/controls/material/SwipeDelegate.qml2
-rw-r--r--src/imports/controls/material/Switch.qml2
-rw-r--r--src/imports/controls/material/ToolButton.qml2
8 files changed, 9 insertions, 9 deletions
diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml
index 4dc9bfc5..ef72b8db 100644
--- a/src/imports/controls/material/Button.qml
+++ b/src/imports/controls/material/Button.qml
@@ -77,7 +77,7 @@ T.Button {
radius: 2
color: !control.enabled ? (control.highlighted ? control.Material.raisedHighlightedButtonDisabledColor : control.Material.raisedButtonDisabledColor) :
(control.pressed ? (control.highlighted ? control.Material.raisedHighlightedButtonPressColor : control.Material.raisedButtonPressColor) :
- (control.activeFocus ? (control.highlighted ? control.Material.raisedHighlightedButtonHoverColor : control.Material.raisedButtonHoverColor) :
+ (control.activeKeyFocus ? (control.highlighted ? control.Material.raisedHighlightedButtonHoverColor : control.Material.raisedButtonHoverColor) :
(control.highlighted ? control.Material.raisedHighlightedButtonColor : control.Material.raisedButtonColor)))
Behavior on color {
@@ -90,7 +90,7 @@ T.Button {
width: parent.width
height: parent.height
radius: parent.radius
- visible: control.activeFocus
+ visible: control.activeKeyFocus
color: control.Material.checkBoxUncheckedRippleColor
}
diff --git a/src/imports/controls/material/CheckBox.qml b/src/imports/controls/material/CheckBox.qml
index fd6ef256..37a06200 100644
--- a/src/imports/controls/material/CheckBox.qml
+++ b/src/imports/controls/material/CheckBox.qml
@@ -86,7 +86,7 @@ T.CheckBox {
height: width
control: control
colored: control.checked
- opacity: control.pressed || control.activeFocus ? 1 : 0
+ opacity: control.pressed || control.activeKeyFocus ? 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 46c25b52..efd5afb6 100644
--- a/src/imports/controls/material/ComboBox.qml
+++ b/src/imports/controls/material/ComboBox.qml
@@ -107,7 +107,7 @@ T.ComboBox {
width: parent.width
height: parent.height
radius: parent.radius
- visible: control.activeFocus
+ visible: control.activeKeyFocus
color: control.Material.checkBoxUncheckedRippleColor
}
}
diff --git a/src/imports/controls/material/RadioButton.qml b/src/imports/controls/material/RadioButton.qml
index 4c8831a5..83dbcefa 100644
--- a/src/imports/controls/material/RadioButton.qml
+++ b/src/imports/controls/material/RadioButton.qml
@@ -71,7 +71,7 @@ T.RadioButton {
height: width
control: control
colored: control.checked
- opacity: control.pressed || control.activeFocus ? 1 : 0
+ opacity: control.pressed || control.activeKeyFocus ? 1 : 0
}
Rectangle {
diff --git a/src/imports/controls/material/Slider.qml b/src/imports/controls/material/Slider.qml
index 18f8ed6e..76752206 100644
--- a/src/imports/controls/material/Slider.qml
+++ b/src/imports/controls/material/Slider.qml
@@ -56,7 +56,7 @@ T.Slider {
x: control.leftPadding + (horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
y: control.topPadding + (horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
value: control.value
- handleHasFocus: control.activeFocus
+ handleHasFocus: control.activeKeyFocus
handlePressed: control.pressed
}
//! [handle]
diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml
index 600eb480..34d546d7 100644
--- a/src/imports/controls/material/SwipeDelegate.qml
+++ b/src/imports/controls/material/SwipeDelegate.qml
@@ -154,7 +154,7 @@ T.SwipeDelegate {
background: Rectangle {
color: !control.enabled ? control.Material.swipeDelegateDisabledColor :
(control.pressed ? control.Material.swipeDelegatePressColor :
- (control.activeFocus || control.hovered ? control.Material.swipeDelegateHoverColor : control.Material.swipeDelegateColor))
+ (control.activeKeyFocus || control.hovered ? control.Material.swipeDelegateHoverColor : control.Material.swipeDelegateColor))
Behavior on x {
enabled: !control.pressed
diff --git a/src/imports/controls/material/Switch.qml b/src/imports/controls/material/Switch.qml
index ca4b1ff6..2ff71644 100644
--- a/src/imports/controls/material/Switch.qml
+++ b/src/imports/controls/material/Switch.qml
@@ -67,7 +67,7 @@ T.Switch {
height: width
control: control
colored: control.checked
- opacity: control.pressed || control.activeFocus ? 1 : 0
+ opacity: control.pressed || control.activeKeyFocus ? 1 : 0
}
Rectangle {
diff --git a/src/imports/controls/material/ToolButton.qml b/src/imports/controls/material/ToolButton.qml
index 34a745c1..f27b6bcc 100644
--- a/src/imports/controls/material/ToolButton.qml
+++ b/src/imports/controls/material/ToolButton.qml
@@ -66,7 +66,7 @@ T.ToolButton {
implicitHeight: 48
color: control.pressed ? control.Material.flatButtonPressColor : control.Material.flatButtonFocusColor
- visible: control.enabled && (control.pressed || control.activeFocus || control.checked || control.highlighted)
+ visible: control.enabled && (control.pressed || control.activeKeyFocus || control.checked || control.highlighted)
}
//! [background]
}