diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-04-11 12:46:55 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-04-11 13:04:45 +0000 |
commit | e7b42b4de0d9148e53a245ffd4eb26338fd9f8dc (patch) | |
tree | 07b0ce7fc52ff61ee9dbdff1f45456ebe2875eca /src/imports/controls/CheckBox.qml | |
parent | 8fd632c65e215925fed12e3b21ab98b77382e3ab (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/CheckBox.qml')
-rw-r--r-- | src/imports/controls/CheckBox.qml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/imports/controls/CheckBox.qml b/src/imports/controls/CheckBox.qml index b12374f0..f6f62ed3 100644 --- a/src/imports/controls/CheckBox.qml +++ b/src/imports/controls/CheckBox.qml @@ -58,14 +58,14 @@ T.CheckBox { x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2 y: control.topPadding + (control.availableHeight - height) / 2 - color: control.enabled ? (control.pressed ? (control.activeFocus ? "#cce0ff" : "#e4e4e4") : "#f6f6f6") : "#353637" - border.width: control.activeFocus ? 2 : 1 - border.color: control.enabled ? (control.activeFocus ? "#0066ff" : (control.pressed ? "#26282a" : "#353637")) : "transparent" + color: control.enabled ? (control.pressed ? (control.activeKeyFocus ? "#cce0ff" : "#e4e4e4") : "#f6f6f6") : "#353637" + border.width: control.activeKeyFocus ? 2 : 1 + border.color: control.enabled ? (control.activeKeyFocus ? "#0066ff" : (control.pressed ? "#26282a" : "#353637")) : "transparent" Image { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - source: "qrc:/qt-project.org/imports/Qt/labs/controls/images/check" + (control.activeFocus ? "-focus.png" : ".png") + source: "qrc:/qt-project.org/imports/Qt/labs/controls/images/check" + (control.activeKeyFocus ? "-focus.png" : ".png") visible: control.checkState === Qt.Checked } @@ -74,7 +74,7 @@ T.CheckBox { y: (parent.height - height) / 2 width: 16 height: 3 - color: control.activeFocus ? "#0066ff" : "#353637" + color: control.activeKeyFocus ? "#0066ff" : "#353637" visible: control.checkState === Qt.PartiallyChecked } } |