Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/AudioStream.qml
Show All 15 Lines | |||||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | import QtQuick 2.0 | 20 | import QtQuick 2.0 | ||
21 | 21 | | |||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 22 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | 23 | | |||
24 | Item { | 24 | MouseArea { | ||
25 | id: audioStreamIconBox | 25 | id: audioStreamIconBox | ||
26 | hoverEnabled: true | ||||
27 | onClicked: toggleMuted() | ||||
26 | 28 | | |||
27 | // Using States rather than a simple Behavior we can apply different transitions, | 29 | // Using States rather than a simple Behavior we can apply different transitions, | ||
28 | // which allows us to delay showing the icon but hide it instantly still. | 30 | // which allows us to delay showing the icon but hide it instantly still. | ||
29 | states: [ | 31 | states: [ | ||
30 | State { | 32 | State { | ||
31 | name: "playing" | 33 | name: "playing" | ||
32 | when: task.playingAudio && !task.muted | 34 | when: task.playingAudio && !task.muted | ||
33 | PropertyChanges { | 35 | PropertyChanges { | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 85 | NumberAnimation { | |||
85 | duration: units.longDuration | 87 | duration: units.longDuration | ||
86 | } | 88 | } | ||
87 | } | 89 | } | ||
88 | ] | 90 | ] | ||
89 | 91 | | |||
90 | opacity: 0 | 92 | opacity: 0 | ||
91 | visible: opacity > 0 | 93 | visible: opacity > 0 | ||
92 | 94 | | |||
95 | PlasmaCore.FrameSvgItem { | ||||
96 | anchors.fill: parent | ||||
97 | visible: parent.containsMouse | ||||
98 | imagePath: "widgets/viewitem" | ||||
99 | prefix: "hover" | ||||
100 | } | ||||
101 | | ||||
93 | PlasmaCore.Svg { | 102 | PlasmaCore.Svg { | ||
94 | id: audioSvg | 103 | id: audioSvg | ||
95 | imagePath: "icons/audio" | 104 | imagePath: "icons/audio" | ||
96 | } | 105 | } | ||
97 | 106 | | |||
98 | PlasmaCore.SvgItem { | 107 | PlasmaCore.SvgItem { | ||
99 | id: audioStreamIcon | 108 | id: audioStreamIcon | ||
100 | svg: audioSvg | 109 | svg: audioSvg | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 171 | PropertyChanges { | |||
163 | target: audioStreamIcon | 172 | target: audioStreamIcon | ||
164 | 173 | | |||
165 | height: parent.height | 174 | height: parent.height | ||
166 | width: parent.width | 175 | width: parent.width | ||
167 | } | 176 | } | ||
168 | } | 177 | } | ||
169 | ] | 178 | ] | ||
170 | } | 179 | } | ||
171 | | ||||
172 | MouseArea { | | |||
173 | anchors.fill: parent | | |||
174 | hoverEnabled: true | | |||
175 | onClicked: toggleMuted() | | |||
176 | | ||||
177 | PlasmaCore.FrameSvgItem { | | |||
178 | anchors.fill: parent | | |||
179 | visible: parent.containsMouse | | |||
180 | imagePath: "widgets/viewitem" | | |||
181 | prefix: "hover" | | |||
182 | } | | |||
183 | } | | |||
184 | } | 180 | } |