1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2025-09-05 10:12:46 +00:00

Added track selection and minor UI improvements

This commit is contained in:
Chris Josten 2020-09-25 17:14:44 +02:00
parent 1eb6a8fb5d
commit 020c968f9c
18 changed files with 271 additions and 68 deletions

View file

@ -81,37 +81,24 @@ Page {
height: Theme.paddingLarge
}
PlainLabel {
id: overviewText
text: itemData.Overview
visible: text.length > 0
font.pixelSize: Theme.fontSizeSmall
Loader {
active: itemData != undefined
asynchronous: true
width: parent.width
source: {
switch (itemData.Type){
case "Movie":
return Qt.resolvedUrl("../components/itemdetails/FilmDetails.qml")
default:
return Qt.resolvedUrl("../components/itemdetails/UnsupportedDetails.qml")
}
}
onLoaded: {
item.itemData = Qt.binding(function() { return pageRoot.itemData; })
}
}
Item {
visible: overviewText.visible
width: 1
height: Theme.paddingLarge
}
Row {
anchors {
//left: parent.left
right: parent.right
leftMargin: Theme.horizontalPageMargin
rightMargin: Theme.horizontalPageMargin
}
spacing: Theme.paddingMedium
IconButton {
id: favouriteButton
icon.source: "image://theme/icon-m-favorite"
}
IconButton {
id: playButton
icon.source: "image://theme/icon-l-play"
onPressed: pageStack.push(Qt.resolvedUrl("VideoPage.qml"), {"itemId": itemId, "itemData": itemData})
}
}
}
}

View file

@ -84,7 +84,7 @@ Page {
}
}
HorizontalScrollDecorator {}
UserItemModel {
UserItemLatestModel {
id: userItemModel
apiClient: ApiClient
parentId: model.id

View file

@ -13,6 +13,9 @@ Page {
id: videoPage
property string itemId
property var itemData
property int audioTrack
property int subtitleTrack
allowedOrientations: Orientation.All
showNavigationIndicator: videoPlayer.hudVisible
@ -22,6 +25,8 @@ Page {
itemId: videoPage.itemId
player: appWindow.mediaPlayer
title: itemData.Name
audioTrack: videoPage.audioTrack
subtitleTrack: videoPage.subtitleTrack
onLandscapeChanged: {
console.log("Is landscape: " + landscape)
@ -31,8 +36,13 @@ Page {
}
onStatusChanged: {
if (status == PageStatus.Inactive) {
switch(status) {
case PageStatus.Inactive:
videoPlayer.stop()
break;
case PageStatus.Active:
appWindow.itemData = videoPage.itemData
break;
}
}
}