You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
latte-dock/declarativeimports/components/private/TextFieldFocus.qml

86 lines
1.9 KiB
QML

/*
SPDX-FileCopyrightText: 2011 Daker Fernandes Pinheiro <dakerfp@gmail.com>
SPDX-FileCopyrightText: 2011 Marco Martin <mart@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
id: main
state: parent.state
PlasmaCore.Svg {
id: lineEditSvg
imagePath: "widgets/lineedit"
onRepaintNeeded: {
if (lineEditSvg.hasElement("hint-focus-over-base")) {
main.z = 800
} else {
main.z = 0
}
}
Component.onCompleted: {
if (lineEditSvg.hasElement("hint-focus-over-base")) {
main.z = 800
} else {
main.z = 0
}
}
}
PlasmaCore.FrameSvgItem {
id: hover
anchors {
fill: parent
leftMargin: -margins.left
topMargin: -margins.top
rightMargin: -margins.right
bottomMargin: -margins.bottom
}
opacity: 0
imagePath: "widgets/lineedit"
prefix: "hover"
}
states: [
State {
name: "hover"
PropertyChanges {
target: hover
opacity: 1
prefix: "hover"
}
},
State {
name: "focus"
PropertyChanges {
target: hover
opacity: 1
prefix: "focus"
}
},
State {
name: "hidden"
PropertyChanges {
target: hover
opacity: 0
prefix: "hover"
}
}
]
transitions: [
Transition {
PropertyAnimation {
properties: "opacity"
duration: units.longDuration
easing.type: Easing.OutQuad
}
}
]
}