touch: Add more PlayerPage implementation
This commit is contained in:
parent
20818b6105
commit
79ecd8fbe4
3 changed files with 41 additions and 26 deletions
|
@ -47,7 +47,7 @@ Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
IconMenuItem {
|
IconMenuItem {
|
||||||
text: 'Play'
|
text: episodeItem.isPlaying ? 'Pause' : 'Play'
|
||||||
iconSource: 'icons/' + (episodeItem.isPlaying ? 'pause_24x32.png' : 'play_24x32.png')
|
iconSource: 'icons/' + (episodeItem.isPlaying ? 'pause_24x32.png' : 'play_24x32.png')
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (episodeItem.isPlaying) {
|
if (episodeItem.isPlaying) {
|
||||||
|
|
|
@ -23,6 +23,7 @@ import QtQuick 2.0
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: contextMenu
|
id: contextMenu
|
||||||
default property alias children: contextMenuRow.children
|
default property alias children: contextMenuRow.children
|
||||||
|
height: 80 * pgst.scalef
|
||||||
|
|
||||||
color: '#33000000'
|
color: '#33000000'
|
||||||
|
|
||||||
|
|
|
@ -20,19 +20,11 @@
|
||||||
|
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
import 'constants.js' as Constants
|
import 'common/util.js' as Util
|
||||||
|
|
||||||
SlidePage {
|
SlidePage {
|
||||||
id: playerPage
|
id: playerPage
|
||||||
|
|
||||||
property string episodeTitle
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
py.call('main.show_episode', [player.episode], function (episode) {
|
|
||||||
playerPage.episodeTitle = episode.title;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
id: flickable
|
id: flickable
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -50,25 +42,47 @@ SlidePage {
|
||||||
title: 'Now playing'
|
title: 'Now playing'
|
||||||
}
|
}
|
||||||
|
|
||||||
ButtonRow {
|
Column {
|
||||||
width: playerPage.width
|
anchors {
|
||||||
model: [
|
left: parent.left
|
||||||
{ label: 'Play', clicked: function() {
|
right: parent.right
|
||||||
player.play();
|
margins: 30 * pgst.scalef
|
||||||
}},
|
}
|
||||||
{ label: 'Pause', clicked: function() {
|
|
||||||
player.pause();
|
PLabel {
|
||||||
}},
|
text: player.episode_title
|
||||||
{ label: 'Details', clicked: function() {
|
elide: Text.ElideRight
|
||||||
pgst.loadPage('EpisodeDetail.qml', {
|
}
|
||||||
episode_id: player.episode,
|
|
||||||
title: playerPage.episodeTitle
|
PLabel {
|
||||||
});
|
text: player.podcast_title
|
||||||
}}
|
elide: Text.ElideRight
|
||||||
]
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IconContextMenu {
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
IconMenuItem {
|
||||||
|
text: player.isPlaying ? 'Pause' : 'Play'
|
||||||
|
iconSource: 'icons/' + (player.isPlaying ? 'pause_24x32.png' : 'play_24x32.png')
|
||||||
|
onClicked: {
|
||||||
|
if (player.isPlaying) {
|
||||||
|
player.pause();
|
||||||
|
} else {
|
||||||
|
player.play();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PLabel {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
text: Util.formatPosition(slider.displayedValue/1000, player.duration/1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
PSlider {
|
PSlider {
|
||||||
|
id: slider
|
||||||
width: playerPage.width
|
width: playerPage.width
|
||||||
value: player.position
|
value: player.position
|
||||||
min: 0
|
min: 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue