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

« back to all changes in this revision

Viewing changes to themes/userbar/private/ButtonShadow.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
/**Documented API
 
22
Inherits:
 
23
        Item
 
24
 
 
25
Imports:
 
26
        QtQuick 1.0
 
27
        org.kde.plasma.core
 
28
 
 
29
Description:
 
30
TODO i need more info here
 
31
 
 
32
 
 
33
Properties:
 
34
**/
 
35
 
 
36
import QtQuick 1.0
 
37
import org.kde.plasma.core 0.1 as PlasmaCore
 
38
 
 
39
Item {
 
40
    id: main
 
41
    state: parent.state
 
42
    //used to tell apart this implementation with the touch components one
 
43
    property bool hasOverState: true
 
44
 
 
45
    PlasmaCore.FrameSvgItem {
 
46
        id: hover
 
47
 
 
48
        anchors {
 
49
            fill: parent
 
50
            leftMargin: -margins.left
 
51
            topMargin: -margins.top
 
52
            rightMargin: -margins.right
 
53
            bottomMargin: -margins.bottom
 
54
        }
 
55
        opacity: 0
 
56
        imagePath: "widgets/button"
 
57
        prefix: "hover"
 
58
    }
 
59
 
 
60
    PlasmaCore.FrameSvgItem {
 
61
        id: shadow
 
62
 
 
63
        anchors {
 
64
            fill: parent
 
65
            leftMargin: -margins.left
 
66
            topMargin: -margins.top
 
67
            rightMargin: -margins.right
 
68
            bottomMargin: -margins.bottom
 
69
        }
 
70
        imagePath: "widgets/button"
 
71
        prefix: "shadow"
 
72
    }
 
73
 
 
74
    states: [
 
75
        State {
 
76
            name: "shadow"
 
77
            PropertyChanges {
 
78
                target: shadow
 
79
                opacity: 1
 
80
            }
 
81
            PropertyChanges {
 
82
                target: hover
 
83
                opacity: 0
 
84
                prefix: "hover"
 
85
            }
 
86
        },
 
87
        State {
 
88
            name: "hover"
 
89
            PropertyChanges {
 
90
                target: shadow
 
91
                opacity: 0
 
92
            }
 
93
            PropertyChanges {
 
94
                target: hover
 
95
                opacity: 1
 
96
                prefix: "hover"
 
97
            }
 
98
        },
 
99
        State {
 
100
            name: "focus"
 
101
            PropertyChanges {
 
102
                target: shadow
 
103
                opacity: 0
 
104
            }
 
105
            PropertyChanges {
 
106
                target: hover
 
107
                opacity: 1
 
108
                prefix: "focus"
 
109
            }
 
110
        },
 
111
        State {
 
112
            name: "hidden"
 
113
            PropertyChanges {
 
114
                target: shadow
 
115
                opacity: 0
 
116
            }
 
117
            PropertyChanges {
 
118
                target: hover
 
119
                opacity: 0
 
120
                prefix: "hover"
 
121
            }
 
122
        }
 
123
    ]
 
124
 
 
125
    transitions: [
 
126
        Transition {
 
127
            PropertyAnimation {
 
128
                properties: "opacity"
 
129
                duration: 250
 
130
                easing.type: Easing.OutQuad
 
131
            }
 
132
        }
 
133
    ]
 
134
}