From e7b42b4de0d9148e53a245ffd4eb26338fd9f8dc Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 11 Apr 2016 12:46:55 +0200 Subject: 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 --- src/imports/controls/CheckBox.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/imports/controls/CheckBox.qml') 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 } } -- cgit v1.2.3