Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/main.qml
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.2 | ||
22 | import QtQuick.Layouts 1.0 | 22 | import QtQuick.Layouts 1.0 | ||
23 | 23 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.components 2.0 as PlasmaComponents | 25 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
26 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 26 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
27 | import org.kde.plasma.plasmoid 2.0 | 27 | import org.kde.plasma.plasmoid 2.0 | ||
28 | 28 | | |||
29 | import org.kde.plasma.private.volume 0.1 | 29 | import org.kde.plasma.private.volume 0.1 | ||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 33 | Item { | |||
150 | 150 | | |||
151 | function playFeedback(sinkIndex) { | 151 | function playFeedback(sinkIndex) { | ||
152 | if (!volumeFeedback) { | 152 | if (!volumeFeedback) { | ||
153 | return; | 153 | return; | ||
154 | } | 154 | } | ||
155 | if (sinkIndex == undefined) { | 155 | if (sinkIndex == undefined) { | ||
156 | sinkIndex = sinkModel.preferredSink.index; | 156 | sinkIndex = sinkModel.preferredSink.index; | ||
157 | } | 157 | } | ||
158 | feedback.play(sinkIndex); | 158 | feedback.sinkIndex = sinkIndex; | ||
159 | } | 159 | } | ||
160 | 160 | | |||
161 | Plasmoid.compactRepresentation: PlasmaCore.IconItem { | 161 | Plasmoid.compactRepresentation: PlasmaCore.IconItem { | ||
162 | source: plasmoid.icon | 162 | source: plasmoid.icon | ||
163 | active: mouseArea.containsMouse | 163 | active: mouseArea.containsMouse | ||
164 | colorGroup: PlasmaCore.ColorScope.colorGroup | 164 | colorGroup: PlasmaCore.ColorScope.colorGroup | ||
165 | 165 | | |||
166 | MouseArea { | 166 | MouseArea { | ||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | |||||
252 | } | 252 | } | ||
253 | 253 | | |||
254 | VolumeOSD { | 254 | VolumeOSD { | ||
255 | id: osd | 255 | id: osd | ||
256 | } | 256 | } | ||
257 | 257 | | |||
258 | VolumeFeedback { | 258 | VolumeFeedback { | ||
259 | id: feedback | 259 | id: feedback | ||
260 | property int sinkIndex: -1 | ||||
260 | } | 261 | } | ||
261 | 262 | | |||
263 | Instantiator { | ||||
264 | active: volumeFeedback | ||||
265 | model: sinkModel | ||||
266 | | ||||
267 | QtObject { | ||||
268 | readonly property int volume: Volume | ||||
269 | | ||||
270 | onVolumeChanged: { | ||||
271 | if (Index == feedback.sinkIndex) { | ||||
272 | feedback.play(Index); | ||||
273 | feedback.sinkIndex = -1; | ||||
274 | } | ||||
275 | } | ||||
276 | } | ||||
277 | } | ||||
278 | | ||||
279 | | ||||
262 | PlasmaComponents.TabBar { | 280 | PlasmaComponents.TabBar { | ||
263 | id: tabBar | 281 | id: tabBar | ||
264 | 282 | | |||
265 | anchors { | 283 | anchors { | ||
266 | top: parent.top | 284 | top: parent.top | ||
267 | left: parent.left | 285 | left: parent.left | ||
268 | right: parent.right | 286 | right: parent.right | ||
269 | } | 287 | } | ||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |