From 0f894f9db284c2622a8fc7e0d24515466e5b2691 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 10 Oct 2011 19:40:46 +0200 Subject: [PATCH] fix the hover/focus frame --- .../plasmacomponents/qml/TextField.qml | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/declarativeimports/plasmacomponents/qml/TextField.qml b/declarativeimports/plasmacomponents/qml/TextField.qml index beaa68158..71bd57681 100644 --- a/declarativeimports/plasmacomponents/qml/TextField.qml +++ b/declarativeimports/plasmacomponents/qml/TextField.qml @@ -113,12 +113,24 @@ Item { } imagePath: "widgets/lineedit" prefix: { - // XXX: missing hover state - if (textField.activeFocus) - return "focus"; - else - return ""; + if (textField.activeFocus) { + return "focus" + } else { + return "hover" + } } + opacity: (mouseWatcher.containsMouse||textField.activeFocus) ? 1 : 0 + Behavior on opacity { + NumberAnimation { + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + MouseArea { + id: mouseWatcher + anchors.fill: hover + hoverEnabled: true } Text {