From 93a8858617c8d0653ba4d0f9e2c54d929cd32b7f Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 10 Oct 2011 19:53:39 +0200 Subject: [PATCH] fix focus frame --- .../plasmacomponents/qml/TextArea.qml | 52 ++++++++++++------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/declarativeimports/plasmacomponents/qml/TextArea.qml b/declarativeimports/plasmacomponents/qml/TextArea.qml index f3a7a3471..839b75a1b 100644 --- a/declarativeimports/plasmacomponents/qml/TextArea.qml +++ b/declarativeimports/plasmacomponents/qml/TextArea.qml @@ -89,6 +89,38 @@ Item { opacity: enabled ? 1.0 : 0.5 + PlasmaCore.FrameSvgItem { + id: hover + + anchors { + fill: base + leftMargin: -margins.left + topMargin: -margins.top + rightMargin: -margins.right + bottomMargin: -margins.bottom + } + imagePath: "widgets/lineedit" + prefix: { + if (textEdit.activeFocus) + return "focus"; + else + return "hover"; + } + + opacity: (mouseWatcher.containsMouse||textArea.activeFocus) ? 1 : 0 + Behavior on opacity { + NumberAnimation { + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + MouseArea { + id: mouseWatcher + anchors.fill: hover + hoverEnabled: true + } + PlasmaCore.FrameSvgItem { id: base @@ -102,26 +134,6 @@ Item { } imagePath: "widgets/lineedit" prefix: "base" - - PlasmaCore.FrameSvgItem { - id: hover - - anchors { - fill: parent - leftMargin: -margins.left - topMargin: -margins.top - rightMargin: -margins.right - bottomMargin: -margins.bottom - } - imagePath: "widgets/lineedit" - prefix: { - // XXX: missing hover state - if (textEdit.activeFocus) - return "focus"; - else - return ""; - } - } } Flickable {