~ubuntu-branches/ubuntu/quantal/lightdm-kde/quantal

« back to all changes in this revision

Viewing changes to themes/userbar/private/TextFieldFocus.qml

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-04-18 15:20:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120418152054-ahcwjazzqvda1u5n
Tags: 0.1.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright (C) 2011 by Daker Fernandes Pinheiro <dakerfp@gmail.com>
 
3
 *   Copyright (C) 2011 by Marco Martin <mart@kde.org>
 
4
 *
 
5
 *   This program is free software; you can redistribute it and/or modify
 
6
 *   it under the terms of the GNU Library General Public License as
 
7
 *   published by the Free Software Foundation; either version 2, or
 
8
 *   (at your option) any later version.
 
9
 *
 
10
 *   This program is distributed in the hope that it will be useful,
 
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *   GNU Library General Public License for more details
 
14
 *
 
15
 *   You should have received a copy of the GNU Library General Public
 
16
 *   License along with this program; if not, write to the
 
17
 *   Free Software Foundation, Inc.,
 
18
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
19
 */
 
20
 
 
21
import QtQuick 1.0
 
22
import org.kde.plasma.core 0.1 as PlasmaCore
 
23
 
 
24
Item {
 
25
    id: main
 
26
    state: parent.state
 
27
 
 
28
    PlasmaCore.Svg {
 
29
        id: lineEditSvg
 
30
        imagePath: "widgets/lineedit"
 
31
        onRepaintNeeded: {
 
32
            if (lineEditSvg.hasElement("hint-focus-over-base")) {
 
33
                main.z = 800
 
34
            } else {
 
35
                main.z = 0
 
36
            }
 
37
        }
 
38
        Component.onCompleted: {
 
39
            if (lineEditSvg.hasElement("hint-focus-over-base")) {
 
40
                main.z = 800
 
41
            } else {
 
42
                main.z = 0
 
43
            }
 
44
        }
 
45
    }
 
46
 
 
47
    PlasmaCore.FrameSvgItem {
 
48
        id: hover
 
49
 
 
50
        anchors {
 
51
            fill: parent
 
52
            leftMargin: -margins.left
 
53
            topMargin: -margins.top
 
54
            rightMargin: -margins.right
 
55
            bottomMargin: -margins.bottom
 
56
        }
 
57
        opacity: 0
 
58
        imagePath: "widgets/lineedit"
 
59
        prefix: "hover"
 
60
    }
 
61
 
 
62
    states: [
 
63
        State {
 
64
            name: "hover"
 
65
            PropertyChanges {
 
66
                target: hover
 
67
                opacity: 1
 
68
                prefix: "hover"
 
69
            }
 
70
        },
 
71
        State {
 
72
            name: "focus"
 
73
            PropertyChanges {
 
74
                target: hover
 
75
                opacity: 1
 
76
                prefix: "focus"
 
77
            }
 
78
        },
 
79
        State {
 
80
            name: "hidden"
 
81
            PropertyChanges {
 
82
                target: hover
 
83
                opacity: 0
 
84
                prefix: "hover"
 
85
            }
 
86
        }
 
87
    ]
 
88
 
 
89
    transitions: [
 
90
        Transition {
 
91
            PropertyAnimation {
 
92
                properties: "opacity"
 
93
                duration: 250
 
94
                easing.type: Easing.OutQuad
 
95
            }
 
96
        }
 
97
    ]
 
98
}