Changeset View
Changeset View
Standalone View
Standalone View
applets/mediacontroller/contents/ui/ExpandedRepresentation.qml
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 27 | Item { | |||
---|---|---|---|---|---|
51 | onIsExpandedChanged: { | 51 | onIsExpandedChanged: { | ||
52 | if (isExpanded) { | 52 | if (isExpanded) { | ||
53 | retrievePosition(); | 53 | retrievePosition(); | ||
54 | } | 54 | } | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | onPositionChanged: { | 57 | onPositionChanged: { | ||
58 | // we don't want to interrupt the user dragging the slider | 58 | // we don't want to interrupt the user dragging the slider | ||
59 | if (!seekSlider.pressed && !keyPressed && !queuedPositionUpdate.running) { | 59 | if (!seekSlider.pressed && !keyPressed) { | ||
60 | // we also don't want passive position updates | 60 | // we also don't want passive position updates | ||
61 | disablePositionUpdate = true | 61 | disablePositionUpdate = true | ||
62 | seekSlider.value = position | 62 | seekSlider.value = position | ||
63 | disablePositionUpdate = false | 63 | disablePositionUpdate = false | ||
64 | } | 64 | } | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | onLengthChanged: { | 67 | onLengthChanged: { | ||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Line(s) | 212 | PlasmaComponents.Slider { | |||
249 | } | 249 | } | ||
250 | } | 250 | } | ||
251 | } | 251 | } | ||
252 | 252 | | |||
253 | Timer { | 253 | Timer { | ||
254 | id: queuedPositionUpdate | 254 | id: queuedPositionUpdate | ||
255 | interval: 100 | 255 | interval: 100 | ||
256 | onTriggered: { | 256 | onTriggered: { | ||
257 | if (position == seekSlider.value) { | ||||
258 | return; | ||||
259 | } | ||||
257 | var service = mpris2Source.serviceForSource(mpris2Source.current) | 260 | var service = mpris2Source.serviceForSource(mpris2Source.current) | ||
258 | var operation = service.operationDescription("SetPosition") | 261 | var operation = service.operationDescription("SetPosition") | ||
259 | operation.microseconds = seekSlider.value | 262 | operation.microseconds = seekSlider.value | ||
260 | service.startOperationCall(operation) | 263 | service.startOperationCall(operation) | ||
261 | } | 264 | } | ||
262 | } | 265 | } | ||
263 | 266 | | |||
264 | Item { | 267 | Item { | ||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |