diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-04-26 12:42:10 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-04-26 13:31:18 +0000 |
commit | 345fb099aa08c72d380fed3330cc8b9d088a3cb4 (patch) | |
tree | 4cf28ead358bc333a27e6b794ca439ad27938289 /src/imports/controls | |
parent | 67f3da65d7d11af025a9bdd54d08ca0bf764c3ce (diff) |
Control: rename activeKeyFocus to visualFocus
This is a bit more flexible, because the name is not strictly coupled
with key focus. We can even add a (re)setter later if we want. This
change only renames the property.
Change-Id: I6707e44040f584480a8712df1af0915ae2829d57
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls')
23 files changed, 51 insertions, 51 deletions
diff --git a/src/imports/controls/Button.qml b/src/imports/controls/Button.qml index c68fc1e8..d9ca2910 100644 --- a/src/imports/controls/Button.qml +++ b/src/imports/controls/Button.qml @@ -55,7 +55,7 @@ T.Button { text: control.text font: control.font opacity: enabled || highlighted ? 1 : 0.3 - color: control.checked || control.highlighted ? "#ffffff" : (control.activeKeyFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637")) + color: control.checked || control.highlighted ? "#ffffff" : (control.visualFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637")) horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter elide: Text.ElideRight @@ -68,10 +68,10 @@ T.Button { implicitHeight: 40 opacity: enabled ? 1 : (control.checked ? 0.2 : 0.3) color: control.checked || control.highlighted ? - (control.activeKeyFocus ? (control.down ? "#599bff" : "#0066ff") : (control.down ? "#585a5c" : "#353637")) : - (control.activeKeyFocus ? (control.down ? "#cce0ff" : "#f0f6ff") : (control.down ? "#d6d6d6" : "#f6f6f6")) - border.color: control.activeKeyFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637") - border.width: control.checked || control.highlighted ? 0 : (control.activeKeyFocus ? 2 : 1) + (control.visualFocus ? (control.down ? "#599bff" : "#0066ff") : (control.down ? "#585a5c" : "#353637")) : + (control.visualFocus ? (control.down ? "#cce0ff" : "#f0f6ff") : (control.down ? "#d6d6d6" : "#f6f6f6")) + border.color: control.visualFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637") + border.width: control.checked || control.highlighted ? 0 : (control.visualFocus ? 2 : 1) } //! [background] } diff --git a/src/imports/controls/CheckIndicator.qml b/src/imports/controls/CheckIndicator.qml index fbaf86af..5f75181e 100644 --- a/src/imports/controls/CheckIndicator.qml +++ b/src/imports/controls/CheckIndicator.qml @@ -44,14 +44,14 @@ Rectangle { implicitWidth: 28 implicitHeight: 28 - color: control.enabled ? (control.down ? (control.activeKeyFocus ? "#cce0ff" : "#e4e4e4") : "#f6f6f6") : "#353637" - border.width: control.activeKeyFocus ? 2 : 1 - border.color: control.enabled ? (control.activeKeyFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637")) : "transparent" + color: control.enabled ? (control.down ? (control.visualFocus ? "#cce0ff" : "#e4e4e4") : "#f6f6f6") : "#353637" + border.width: control.visualFocus ? 2 : 1 + border.color: control.enabled ? (control.visualFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637")) : "transparent" Image { x: (parent.width - width) / 2 y: (parent.height - height) / 2 - source: "image://default/check/" + (control.activeKeyFocus ? "#0066ff" : "#353637") + source: "image://default/check/" + (control.visualFocus ? "#0066ff" : "#353637") visible: control.checkState === Qt.Checked } @@ -60,7 +60,7 @@ Rectangle { y: (parent.height - height) / 2 width: 16 height: 3 - color: control.activeKeyFocus ? "#0066ff" : "#353637" + color: control.visualFocus ? "#0066ff" : "#353637" visible: control.checkState === Qt.PartiallyChecked } } diff --git a/src/imports/controls/ComboBox.qml b/src/imports/controls/ComboBox.qml index 66d27da4..0ab7bf24 100644 --- a/src/imports/controls/ComboBox.qml +++ b/src/imports/controls/ComboBox.qml @@ -66,7 +66,7 @@ T.ComboBox { contentItem: Text { text: control.displayText font: control.font - color: control.activeKeyFocus ? "#0066ff" : "#353637" + color: control.visualFocus ? "#0066ff" : "#353637" horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter elide: Text.ElideRight @@ -79,22 +79,22 @@ T.ComboBox { implicitWidth: 120 implicitHeight: 40 - color: control.activeKeyFocus ? (control.pressed ? "#cce0ff" : "#f0f6ff") : + color: control.visualFocus ? (control.pressed ? "#cce0ff" : "#f0f6ff") : (control.pressed || popup.visible ? "#d6d6d6" : "#f6f6f6") - border.color: control.activeKeyFocus ? "#0066ff" : "#353637" - border.width: control.activeKeyFocus ? 2 : 1 + border.color: control.visualFocus ? "#0066ff" : "#353637" + border.width: control.visualFocus ? 2 : 1 Image { x: parent.width - width - 4 y: (parent.height - height) / 2 - source: "image://default/double-arrow/" + (control.activeKeyFocus ? "#0066ff" : "#353637") + source: "image://default/double-arrow/" + (control.visualFocus ? "#0066ff" : "#353637") } } //! [background] //! [popup] popup: T.Popup { - y: control.height - (control.activeKeyFocus ? 0 : 1) + y: control.height - (control.visualFocus ? 0 : 1) implicitWidth: control.width implicitHeight: listview.contentHeight topMargin: 6 diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml index 55fd7a4b..9db51384 100644 --- a/src/imports/controls/Dial.qml +++ b/src/imports/controls/Dial.qml @@ -49,7 +49,7 @@ T.Dial { background: DialRing { width: control.availableWidth height: control.availableHeight - color: control.activeKeyFocus ? "#0066ff" : "#353637" + color: control.visualFocus ? "#0066ff" : "#353637" progress: control.position opacity: control.enabled ? 1 : 0.3 } @@ -62,7 +62,7 @@ T.Dial { y: background.y + background.height / 2 - handle.height / 2 width: 14 height: 10 - source: "image://default/dial-indicator/" + (control.activeKeyFocus ? "#0066ff" : "#353637") + source: "image://default/dial-indicator/" + (control.visualFocus ? "#0066ff" : "#353637") antialiasing: true opacity: control.enabled ? 1 : 0.3 transform: [ diff --git a/src/imports/controls/ItemDelegate.qml b/src/imports/controls/ItemDelegate.qml index 42d207de..d884a328 100644 --- a/src/imports/controls/ItemDelegate.qml +++ b/src/imports/controls/ItemDelegate.qml @@ -69,8 +69,8 @@ T.ItemDelegate { background: Rectangle { implicitWidth: 100 implicitHeight: 40 - visible: control.down || control.highlighted || control.activeKeyFocus - color: control.activeKeyFocus ? (control.pressed ? "#cce0ff" : "#e5efff") : (control.down ? "#bdbebf" : "#eeeeee") + visible: control.down || control.highlighted || control.visualFocus + color: control.visualFocus ? (control.pressed ? "#cce0ff" : "#e5efff") : (control.down ? "#bdbebf" : "#eeeeee") } //! [background] } diff --git a/src/imports/controls/MenuItem.qml b/src/imports/controls/MenuItem.qml index 0e66c1cc..ead943b0 100644 --- a/src/imports/controls/MenuItem.qml +++ b/src/imports/controls/MenuItem.qml @@ -84,7 +84,7 @@ T.MenuItem { y: 1 width: parent.width - 2 height: parent.height - 2 - color: control.activeKeyFocus || control.down ? "#eeeeee" : "transparent" + color: control.visualFocus || control.down ? "#eeeeee" : "transparent" } } //! [background] diff --git a/src/imports/controls/RadioIndicator.qml b/src/imports/controls/RadioIndicator.qml index 68b283c0..2223cfe2 100644 --- a/src/imports/controls/RadioIndicator.qml +++ b/src/imports/controls/RadioIndicator.qml @@ -41,9 +41,9 @@ Rectangle { implicitHeight: 28 radius: width / 2 - color: control.down ? (control.activeKeyFocus ? "#cce0ff" : "#e4e4e4") : "#f6f6f6" - border.width: control.activeKeyFocus ? 2 : 1 - border.color: control.activeKeyFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637") + color: control.down ? (control.visualFocus ? "#cce0ff" : "#e4e4e4") : "#f6f6f6" + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? "#0066ff" : (control.down ? "#26282a" : "#353637") property Item control diff --git a/src/imports/controls/SwitchIndicator.qml b/src/imports/controls/SwitchIndicator.qml index cd4e2c73..ead6b64c 100644 --- a/src/imports/controls/SwitchIndicator.qml +++ b/src/imports/controls/SwitchIndicator.qml @@ -47,9 +47,9 @@ Item { width: 56 height: 16 radius: 8 - color: control.checked ? (control.activeKeyFocus ? "#0066ff" : "#353637") : "#ffffff" - border.width: control.activeKeyFocus ? 2 : 1 - border.color: control.checked ? "transparent" : (control.activeKeyFocus ? "#0066ff" : "#353637") + color: control.checked ? (control.visualFocus ? "#0066ff" : "#353637") : "#ffffff" + border.width: control.visualFocus ? 2 : 1 + border.color: control.checked ? "transparent" : (control.visualFocus ? "#0066ff" : "#353637") } Rectangle { @@ -58,9 +58,9 @@ Item { width: 28 height: 28 radius: 16 - color: control.pressed ? (control.activeKeyFocus ? "#cce0ff" : "#e4e4e4") : (control.activeKeyFocus ? "#f0f6ff" : "#f6f6f6") - border.width: control.activeKeyFocus ? 2 : 1 - border.color: control.activeKeyFocus ? "#0066ff" : (control.pressed ? "#26282a" : "#353637") + color: control.pressed ? (control.visualFocus ? "#cce0ff" : "#e4e4e4") : (control.visualFocus ? "#f0f6ff" : "#f6f6f6") + border.width: control.visualFocus ? 2 : 1 + border.color: control.visualFocus ? "#0066ff" : (control.pressed ? "#26282a" : "#353637") Behavior on x { enabled: !control.pressed diff --git a/src/imports/controls/material/Button.qml b/src/imports/controls/material/Button.qml index 1be54234..6ef27a5a 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.down ? (control.highlighted ? control.Material.raisedHighlightedButtonPressColor : control.Material.raisedButtonPressColor) : - (control.activeKeyFocus ? (control.highlighted ? control.Material.raisedHighlightedButtonHoverColor : control.Material.raisedButtonHoverColor) : + (control.visualFocus ? (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.activeKeyFocus + visible: control.visualFocus color: control.Material.checkBoxUncheckedRippleColor } diff --git a/src/imports/controls/material/ComboBox.qml b/src/imports/controls/material/ComboBox.qml index 49f4554e..a46994bc 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.activeKeyFocus + visible: control.visualFocus color: control.Material.checkBoxUncheckedRippleColor } } diff --git a/src/imports/controls/material/RadioIndicator.qml b/src/imports/controls/material/RadioIndicator.qml index dbd950de..4090c732 100644 --- a/src/imports/controls/material/RadioIndicator.qml +++ b/src/imports/controls/material/RadioIndicator.qml @@ -54,7 +54,7 @@ Rectangle { height: width control: control colored: control.checked - opacity: control.down || control.activeKeyFocus ? 1 : 0 + opacity: control.down || control.visualFocus ? 1 : 0 } Rectangle { diff --git a/src/imports/controls/material/Slider.qml b/src/imports/controls/material/Slider.qml index 8401bea5..d6280b67 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.activeKeyFocus + handleHasFocus: control.visualFocus handlePressed: control.pressed } //! [handle] diff --git a/src/imports/controls/material/SwipeDelegate.qml b/src/imports/controls/material/SwipeDelegate.qml index 4dc666e7..858c914d 100644 --- a/src/imports/controls/material/SwipeDelegate.qml +++ b/src/imports/controls/material/SwipeDelegate.qml @@ -79,7 +79,7 @@ T.SwipeDelegate { background: Rectangle { color: !control.enabled ? control.Material.swipeDelegateDisabledColor : (control.down ? control.Material.swipeDelegatePressColor : - (control.activeKeyFocus || control.hovered ? control.Material.swipeDelegateHoverColor : control.Material.swipeDelegateColor)) + (control.visualFocus || control.hovered ? control.Material.swipeDelegateHoverColor : control.Material.swipeDelegateColor)) Behavior on x { enabled: !control.down diff --git a/src/imports/controls/material/SwitchIndicator.qml b/src/imports/controls/material/SwitchIndicator.qml index 403587b9..93b4c9f6 100644 --- a/src/imports/controls/material/SwitchIndicator.qml +++ b/src/imports/controls/material/SwitchIndicator.qml @@ -52,7 +52,7 @@ Item { width: handle.width height: width colored: control.checked - opacity: control.pressed || control.activeKeyFocus ? 1 : 0 + opacity: control.pressed || control.visualFocus ? 1 : 0 } Rectangle { diff --git a/src/imports/controls/material/ToolButton.qml b/src/imports/controls/material/ToolButton.qml index a02254c4..22a81c76 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.down ? control.Material.flatButtonPressColor : control.Material.flatButtonFocusColor - visible: control.enabled && (control.down || control.activeKeyFocus || control.checked || control.highlighted) + visible: control.enabled && (control.down || control.visualFocus || control.checked || control.highlighted) } //! [background] } diff --git a/src/imports/controls/universal/ApplicationWindow.qml b/src/imports/controls/universal/ApplicationWindow.qml index e0a0b351..664229a3 100644 --- a/src/imports/controls/universal/ApplicationWindow.qml +++ b/src/imports/controls/universal/ApplicationWindow.qml @@ -52,6 +52,6 @@ T.ApplicationWindow { parent: window.activeFocusControl width: parent ? parent.width : 0 height: parent ? parent.height : 0 - visible: parent && !!parent.useSystemFocusVisuals && !!parent.activeKeyFocus + visible: parent && !!parent.useSystemFocusVisuals && !!parent.visualFocus } } diff --git a/src/imports/controls/universal/CheckDelegate.qml b/src/imports/controls/universal/CheckDelegate.qml index da8fe326..d693ead1 100644 --- a/src/imports/controls/universal/CheckDelegate.qml +++ b/src/imports/controls/universal/CheckDelegate.qml @@ -82,12 +82,12 @@ T.CheckDelegate { //! [background] background: Rectangle { - visible: control.down || control.highlighted || control.activeKeyFocus + visible: control.down || control.highlighted || control.visualFocus color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor Rectangle { width: parent.width height: parent.height - visible: control.activeKeyFocus || control.highlighted + visible: control.visualFocus || control.highlighted color: control.Universal.accent opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6 } diff --git a/src/imports/controls/universal/ComboBox.qml b/src/imports/controls/universal/ComboBox.qml index 07e92a0e..bfb202bc 100644 --- a/src/imports/controls/universal/ComboBox.qml +++ b/src/imports/controls/universal/ComboBox.qml @@ -94,7 +94,7 @@ T.ComboBox { width: parent.width - 4 height: parent.height - 4 - visible: control.activeKeyFocus + visible: control.visualFocus color: control.Universal.accent opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6 } diff --git a/src/imports/controls/universal/ItemDelegate.qml b/src/imports/controls/universal/ItemDelegate.qml index 1bdcd620..e02eac69 100644 --- a/src/imports/controls/universal/ItemDelegate.qml +++ b/src/imports/controls/universal/ItemDelegate.qml @@ -74,12 +74,12 @@ T.ItemDelegate { //! [background] background: Rectangle { - visible: control.down || control.highlighted || control.activeKeyFocus + visible: control.down || control.highlighted || control.visualFocus color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor Rectangle { width: parent.width height: parent.height - visible: control.activeKeyFocus || control.highlighted + visible: control.visualFocus || control.highlighted color: control.Universal.accent opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6 } diff --git a/src/imports/controls/universal/MenuItem.qml b/src/imports/controls/universal/MenuItem.qml index e14884ef..c8561cbf 100644 --- a/src/imports/controls/universal/MenuItem.qml +++ b/src/imports/controls/universal/MenuItem.qml @@ -92,7 +92,7 @@ T.MenuItem { width: parent.width - 2 height: parent.height - 2 - visible: control.activeKeyFocus + visible: control.visualFocus color: control.Universal.accent opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6 } diff --git a/src/imports/controls/universal/RadioDelegate.qml b/src/imports/controls/universal/RadioDelegate.qml index 3b9214ae..9fe984bd 100644 --- a/src/imports/controls/universal/RadioDelegate.qml +++ b/src/imports/controls/universal/RadioDelegate.qml @@ -84,12 +84,12 @@ T.RadioDelegate { //! [background] background: Rectangle { - visible: control.down || control.highlighted || control.activeKeyFocus + visible: control.down || control.highlighted || control.visualFocus color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor Rectangle { width: parent.width height: parent.height - visible: control.activeKeyFocus || control.highlighted + visible: control.visualFocus || control.highlighted color: control.Universal.accent opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6 } diff --git a/src/imports/controls/universal/SwipeDelegate.qml b/src/imports/controls/universal/SwipeDelegate.qml index c908e517..02a2fa65 100644 --- a/src/imports/controls/universal/SwipeDelegate.qml +++ b/src/imports/controls/universal/SwipeDelegate.qml @@ -85,12 +85,12 @@ T.SwipeDelegate { background: Rectangle { color: !control.enabled ? control.Universal.chromeDisabledHighColor : (control.down ? control.Universal.chromeHighColor : - (control.activeKeyFocus || control.hovered ? control.Universal.chromeLowColor : control.Universal.chromeMediumColor)) + (control.visualFocus || control.hovered ? control.Universal.chromeLowColor : control.Universal.chromeMediumColor)) Rectangle { width: parent.width height: parent.height - visible: control.activeKeyFocus || control.highlighted + visible: control.visualFocus || control.highlighted color: control.Universal.accent opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6 } diff --git a/src/imports/controls/universal/SwitchDelegate.qml b/src/imports/controls/universal/SwitchDelegate.qml index 0d58824e..25652f1b 100644 --- a/src/imports/controls/universal/SwitchDelegate.qml +++ b/src/imports/controls/universal/SwitchDelegate.qml @@ -82,12 +82,12 @@ T.SwitchDelegate { //! [background] background: Rectangle { - visible: control.down || control.highlighted || control.activeKeyFocus + visible: control.down || control.highlighted || control.visualFocus color: control.down ? control.Universal.listMediumColor : control.Universal.altMediumLowColor Rectangle { width: parent.width height: parent.height - visible: control.activeKeyFocus || control.highlighted + visible: control.visualFocus || control.highlighted color: control.Universal.accent opacity: control.Universal.theme === Universal.Light ? 0.4 : 0.6 } |