From 996f194ecdcc07dc71db1f28de5798bcf387b63d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 8 Sep 2017 12:27:34 +0200 Subject: Use the background instead of an overlay --- framework/qml/RequiredTextField.qml | 8 ++------ framework/qml/TextField.qml | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/framework/qml/RequiredTextField.qml b/framework/qml/RequiredTextField.qml index 2e3512a4..9ee3bece 100644 --- a/framework/qml/RequiredTextField.qml +++ b/framework/qml/RequiredTextField.qml @@ -23,10 +23,6 @@ import org.kube.framework 1.0 as Kube Kube.TextField { id: root validator: RegExpValidator { regExp: /.*\S.*/ } - Rectangle { - anchors.fill: parent - opacity: 0.2 - color: Kube.Colors.warningColor - visible: !root.acceptableInput - } + backgroundColor: acceptableInput ? Kube.Colors.viewBackgroundColor : Kube.Colors.warningColor + backgroundOpacity: acceptableInput ? 1.0 : 0.2 } diff --git a/framework/qml/TextField.qml b/framework/qml/TextField.qml index cfb1478d..feb34a33 100644 --- a/framework/qml/TextField.qml +++ b/framework/qml/TextField.qml @@ -23,6 +23,9 @@ import org.kube.framework 1.0 as Kube T.TextField { id: root + property alias backgroundColor: background.color + property alias backgroundOpacity: background.opacity + implicitHeight: Kube.Units.gridUnit + Kube.Units.smallSpacing * 2 implicitWidth: Kube.Units.gridUnit * 5 + Kube.Units.smallSpacing * 2 @@ -48,6 +51,7 @@ T.TextField { } background: Rectangle { + id: background color: Kube.Colors.viewBackgroundColor border.width: 1 border.color: root.activeFocus ? Kube.Colors.highlightColor : Kube.Colors.buttonColor -- cgit v1.2.3