Changeset View
Changeset View
Standalone View
Standalone View
applets/mediacontroller/contents/ui/ExpandedRepresentation.qml
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 28 | Item { | |||
---|---|---|---|---|---|
87 | Keys.onReleased: { | 87 | Keys.onReleased: { | ||
88 | keyPressed = false | 88 | keyPressed = false | ||
89 | 89 | | |||
90 | if (!event.modifiers) { | 90 | if (!event.modifiers) { | ||
91 | event.accepted = true | 91 | event.accepted = true | ||
92 | 92 | | |||
93 | if (event.key === Qt.Key_Space || event.key === Qt.Key_K) { | 93 | if (event.key === Qt.Key_Space || event.key === Qt.Key_K) { | ||
94 | // K is YouTube's key for "play/pause" :) | 94 | // K is YouTube's key for "play/pause" :) | ||
95 | root.action_playPause() | 95 | root.togglePlaying() | ||
96 | } else if (event.key === Qt.Key_P) { | 96 | } else if (event.key === Qt.Key_P) { | ||
97 | root.action_previous() | 97 | root.action_previous() | ||
98 | } else if (event.key === Qt.Key_N) { | 98 | } else if (event.key === Qt.Key_N) { | ||
99 | root.action_next() | 99 | root.action_next() | ||
100 | } else if (event.key === Qt.Key_S) { | 100 | } else if (event.key === Qt.Key_S) { | ||
101 | root.action_stop() | 101 | root.action_stop() | ||
102 | } else if (event.key === Qt.Key_Left || event.key === Qt.Key_J) { // TODO ltr languages | 102 | } else if (event.key === Qt.Key_Left || event.key === Qt.Key_J) { // TODO ltr languages | ||
103 | // seek back 5s | 103 | // seek back 5s | ||
▲ Show 20 Lines • Show All 269 Lines • ▼ Show 20 Line(s) | 364 | PlasmaComponents.ToolButton { | |||
373 | } | 373 | } | ||
374 | } | 374 | } | ||
375 | 375 | | |||
376 | PlasmaComponents.ToolButton { | 376 | PlasmaComponents.ToolButton { | ||
377 | width: Math.round(expandedRepresentation.controlSize * 1.5) | 377 | width: Math.round(expandedRepresentation.controlSize * 1.5) | ||
378 | height: width | 378 | height: width | ||
379 | enabled: root.state == "playing" ? root.canPause : root.canPlay | 379 | enabled: root.state == "playing" ? root.canPause : root.canPlay | ||
380 | iconSource: root.state == "playing" ? "media-playback-pause" : "media-playback-start" | 380 | iconSource: root.state == "playing" ? "media-playback-pause" : "media-playback-start" | ||
381 | onClicked: root.action_playPause() | 381 | onClicked: root.togglePlaying(); | ||
382 | } | 382 | } | ||
383 | 383 | | |||
384 | PlasmaComponents.ToolButton { | 384 | PlasmaComponents.ToolButton { | ||
385 | anchors.verticalCenter: parent.verticalCenter | 385 | anchors.verticalCenter: parent.verticalCenter | ||
386 | width: expandedRepresentation.controlSize | 386 | width: expandedRepresentation.controlSize | ||
387 | height: width | 387 | height: width | ||
388 | enabled: playerControls.enabled && root.canGoNext | 388 | enabled: playerControls.enabled && root.canGoNext | ||
389 | iconSource: LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward" | 389 | iconSource: LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward" | ||
390 | onClicked: { | 390 | onClicked: { | ||
391 | seekSlider.value = 0 // Let the media start from beginning. Bug 362473 | 391 | seekSlider.value = 0 // Let the media start from beginning. Bug 362473 | ||
392 | root.action_next() | 392 | root.action_next() | ||
393 | } | 393 | } | ||
394 | } | 394 | } | ||
395 | } | 395 | } | ||
396 | } | 396 | } | ||
397 | } | 397 | } |