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

« back to all changes in this revision

Viewing changes to plasma/declarativeimports/plasmacomponents/platformcomponents/touch/private/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
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
    property alias imagePath: shadowSvg.imagePath
 
28
    property string hoverElement: "hover"
 
29
    property string focusElement: "focus"
 
30
    property alias shadowElement: shadow.elementId
 
31
 
 
32
    PlasmaCore.Svg {
 
33
        id: shadowSvg
 
34
        imagePath: "widgets/actionbutton"
 
35
    }
 
36
 
 
37
    PlasmaCore.SvgItem {
 
38
        id: hover
 
39
        svg: shadowSvg
 
40
        elementId: "hover"
 
41
 
 
42
        anchors.fill: parent
 
43
 
 
44
        opacity: 0
 
45
    }
 
46
 
 
47
    PlasmaCore.SvgItem {
 
48
        id: shadow
 
49
        svg: shadowSvg
 
50
        elementId: "shadow"
 
51
 
 
52
        anchors.fill: parent
 
53
    }
 
54
 
 
55
    states: [
 
56
        State {
 
57
            name: "shadow"
 
58
            PropertyChanges {
 
59
                target: shadow
 
60
                opacity: 1
 
61
            }
 
62
            PropertyChanges {
 
63
                target: hover
 
64
                opacity: 0
 
65
                elementId: hoverElement
 
66
            }
 
67
        },
 
68
        State {
 
69
            name: "focus"
 
70
            PropertyChanges {
 
71
                target: shadow
 
72
                opacity: 0
 
73
            }
 
74
            PropertyChanges {
 
75
                target: hover
 
76
                opacity: 1
 
77
                elementId: focusElement
 
78
            }
 
79
        },
 
80
        State {
 
81
            name: "hidden"
 
82
            PropertyChanges {
 
83
                target: shadow
 
84
                opacity: 0
 
85
            }
 
86
            PropertyChanges {
 
87
                target: hover
 
88
                opacity: 0
 
89
                elementId: hoverElement
 
90
            }
 
91
        }
 
92
    ]
 
93
 
 
94
    transitions: [
 
95
        Transition {
 
96
            PropertyAnimation {
 
97
                properties: "opacity"
 
98
                duration: 250
 
99
                easing.type: Easing.OutQuad
 
100
            }
 
101
        }
 
102
    ]
 
103
}