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

« back to all changes in this revision

Viewing changes to plasma/declarativeimports/plasmacomponents/qml/RoundShadow.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
 
        It is a simple Radio button which is using the plasma theme.
31
 
        TODO Do we need more info?
32
 
 
33
 
Properties:
34
 
        TODO needs more info??
35
 
**/
36
 
 
37
 
import QtQuick 1.0
38
 
import org.kde.plasma.core 0.1 as PlasmaCore
39
 
 
40
 
Item {
41
 
    id: main
42
 
    state: parent.state
43
 
    property alias imagePath: shadowSvg.imagePath
44
 
    property string hoverElement: "hover"
45
 
    property string focusElement: "focus"
46
 
    property alias shadowElement: shadow.elementId
47
 
 
48
 
    PlasmaCore.Svg {
49
 
        id: shadowSvg
50
 
        imagePath: "widgets/actionbutton"
51
 
    }
52
 
 
53
 
    PlasmaCore.SvgItem {
54
 
        id: hover
55
 
        svg: shadowSvg
56
 
        elementId: "hover"
57
 
 
58
 
        anchors.fill: parent
59
 
 
60
 
        opacity: 0
61
 
    }
62
 
 
63
 
    PlasmaCore.SvgItem {
64
 
        id: shadow
65
 
        svg: shadowSvg
66
 
        elementId: "shadow"
67
 
 
68
 
        anchors.fill: parent
69
 
    }
70
 
 
71
 
    states: [
72
 
        State {
73
 
            name: "shadow"
74
 
            PropertyChanges {
75
 
                target: shadow
76
 
                opacity: 1
77
 
            }
78
 
            PropertyChanges {
79
 
                target: hover
80
 
                opacity: 0
81
 
                elementId: hoverElement
82
 
            }
83
 
        },
84
 
        State {
85
 
            name: "hover"
86
 
            PropertyChanges {
87
 
                target: shadow
88
 
                opacity: 0
89
 
            }
90
 
            PropertyChanges {
91
 
                target: hover
92
 
                opacity: 1
93
 
                elementId: hoverElement
94
 
            }
95
 
        },
96
 
        State {
97
 
            name: "focus"
98
 
            PropertyChanges {
99
 
                target: shadow
100
 
                opacity: 0
101
 
            }
102
 
            PropertyChanges {
103
 
                target: hover
104
 
                opacity: 1
105
 
                elementId: focusElement
106
 
            }
107
 
        },
108
 
        State {
109
 
            name: "hidden"
110
 
            PropertyChanges {
111
 
                target: shadow
112
 
                opacity: 0
113
 
            }
114
 
            PropertyChanges {
115
 
                target: hover
116
 
                opacity: 0
117
 
                elementId: hoverElement
118
 
            }
119
 
        }
120
 
    ]
121
 
 
122
 
    transitions: [
123
 
        Transition {
124
 
            PropertyAnimation {
125
 
                properties: "opacity"
126
 
                duration: 250
127
 
                easing.type: Easing.OutQuad
128
 
            }
129
 
        }
130
 
    ]
131
 
}