~ubuntu-branches/ubuntu/quantal/kde-runtime/quantal

« back to all changes in this revision

Viewing changes to plasma/declarativeimports/plasmacomponents/qml/ButtonShadow.qml

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-06-03 21:50:00 UTC
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: package-import@ubuntu.com-20120603215000-vn7oarsq0ynrydj5
Tags: upstream-4.8.80
Import upstream version 4.8.80

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
 
/**Documentanted 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
 
    property bool hasOverState: true
43
 
 
44
 
    PlasmaCore.FrameSvgItem {
45
 
        id: hover
46
 
 
47
 
        anchors {
48
 
            fill: parent
49
 
            leftMargin: -margins.left
50
 
            topMargin: -margins.top
51
 
            rightMargin: -margins.right
52
 
            bottomMargin: -margins.bottom
53
 
        }
54
 
        opacity: 0
55
 
        imagePath: "widgets/button"
56
 
        prefix: "hover"
57
 
    }
58
 
 
59
 
    PlasmaCore.FrameSvgItem {
60
 
        id: shadow
61
 
 
62
 
        anchors {
63
 
            fill: parent
64
 
            leftMargin: -margins.left
65
 
            topMargin: -margins.top
66
 
            rightMargin: -margins.right
67
 
            bottomMargin: -margins.bottom
68
 
        }
69
 
        imagePath: "widgets/button"
70
 
        prefix: "shadow"
71
 
    }
72
 
 
73
 
    states: [
74
 
        State {
75
 
            name: "shadow"
76
 
            PropertyChanges {
77
 
                target: shadow
78
 
                opacity: 1
79
 
            }
80
 
            PropertyChanges {
81
 
                target: hover
82
 
                opacity: 0
83
 
                prefix: "hover"
84
 
            }
85
 
        },
86
 
        State {
87
 
            name: "hover"
88
 
            PropertyChanges {
89
 
                target: shadow
90
 
                opacity: 0
91
 
            }
92
 
            PropertyChanges {
93
 
                target: hover
94
 
                opacity: 1
95
 
                prefix: "hover"
96
 
            }
97
 
        },
98
 
        State {
99
 
            name: "focus"
100
 
            PropertyChanges {
101
 
                target: shadow
102
 
                opacity: 0
103
 
            }
104
 
            PropertyChanges {
105
 
                target: hover
106
 
                opacity: 1
107
 
                prefix: "focus"
108
 
            }
109
 
        },
110
 
        State {
111
 
            name: "hidden"
112
 
            PropertyChanges {
113
 
                target: shadow
114
 
                opacity: 0
115
 
            }
116
 
            PropertyChanges {
117
 
                target: hover
118
 
                opacity: 0
119
 
                prefix: "hover"
120
 
            }
121
 
        }
122
 
    ]
123
 
 
124
 
    transitions: [
125
 
        Transition {
126
 
            PropertyAnimation {
127
 
                properties: "opacity"
128
 
                duration: 250
129
 
                easing.type: Easing.OutQuad
130
 
            }
131
 
        }
132
 
    ]
133
 
}