Plasma

plasmacomponents3/private/RoundShadow.qml
1 /*
2  * Copyright (C) 2011 by Daker Fernandes Pinheiro <[email protected]>
3  * Copyright (C) 2011 by Marco Martin <[email protected]>
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 2.010-1301, USA.
19  */
20 
37 import QtQuick 2.1
38 import org.kde.plasma.core 2.0 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  //used to tell apart this implementation with the touch components one
49  property bool hasOverState: true
50 
51  PlasmaCore.Svg {
52  id: shadowSvg
53  imagePath: "widgets/actionbutton"
54  }
55 
56  PlasmaCore.SvgItem {
57  id: hover
58  svg: shadowSvg
59  elementId: "hover"
60 
61  anchors.fill: parent
62 
63  opacity: 0
64  }
65 
66  PlasmaCore.SvgItem {
67  id: shadow
68  svg: shadowSvg
69  elementId: "shadow"
70 
71  anchors.fill: parent
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  elementId: hoverElement
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  elementId: hoverElement
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  elementId: focusElement
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  elementId: hoverElement
121  }
122  }
123  ]
124 
125  transitions: [
126  Transition {
127  PropertyAnimation {
128  properties: "opacity"
129  duration: units.longDuration
130  easing.type: Easing.OutQuad
131  }
132  }
133  ]
134 }
State
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 4 2020 22:41:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.