mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-11-24 18:15:16 +00:00
Small UI modifications
* Fixed pulleyindicator staying busy in collectionpage * PlaybackBar now correctly disables next/previous buttons * AppWindow now handles the pushing for pages when an items needs to be visited. * Clicking on an item of type audio now starts the audio player
This commit is contained in:
parent
5d521ee189
commit
40d8a58a5a
|
@ -91,7 +91,9 @@ ApplicationWindow {
|
|||
color: "white"
|
||||
}
|
||||
Text {
|
||||
text: "%1\n%2".arg(playbackManager.item.name ? playbackManager.item.name : "Nothing").arg(playbackManager.streamUrl)
|
||||
text: "%1\n%2"
|
||||
.arg(playbackManager.item.name ? playbackManager.item.name : "Nothing")
|
||||
.arg(playbackManager.error === MediaPlayer.NoError ? playbackManager.streamUrl : playbackManager.errorString)
|
||||
color: "white"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -325,10 +325,10 @@ PanelBackground {
|
|||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: previousButton; opacity: 1; enabled: true;
|
||||
target: previousButton; opacity: 1; enabled: playbackManager.hasPrevious;
|
||||
}
|
||||
PropertyChanges {
|
||||
target: nextButton; opacity: 1; enabled: true;
|
||||
target: nextButton; opacity: 1; enabled: playbackManager.hasNext;
|
||||
}
|
||||
PropertyChanges {
|
||||
target: playModeButton; opacity: 1; enabled: true;
|
||||
|
@ -423,16 +423,24 @@ PanelBackground {
|
|||
allowedOrientations: appWindow.allowedOrientations
|
||||
SilicaFlickable {
|
||||
anchors.fill: parent
|
||||
/*PullDownMenu {
|
||||
MenuItem {
|
||||
PullDownMenu {
|
||||
/*MenuItem {
|
||||
//: Pulley menu item to view detailed media information of a song
|
||||
text: qsTr("Info")
|
||||
}
|
||||
MenuItem {
|
||||
//: Pulley menu item: add music to a playlist
|
||||
text: qsTr("Add to playlist")
|
||||
}*/
|
||||
MenuItem {
|
||||
//: Pulley menu item: stops playback of music
|
||||
text: qsTr("Stop")
|
||||
onClicked: {
|
||||
playbackManager.stop()
|
||||
pageStack.pop()
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
Loader {
|
||||
Component.onCompleted: setSource(Qt.resolvedUrl("PlaybackBar.qml"),
|
||||
{"isFullPage": true, "manager": manager, "y": 0})
|
||||
|
|
|
@ -28,7 +28,7 @@ import Nemo.KeepAlive 1.2
|
|||
|
||||
import "components"
|
||||
import "pages"
|
||||
import "." as D
|
||||
import "."
|
||||
|
||||
ApplicationWindow {
|
||||
id: appWindow
|
||||
|
@ -50,7 +50,7 @@ ApplicationWindow {
|
|||
ApiClient {
|
||||
id: _apiClient
|
||||
objectName: "Test"
|
||||
supportedCommands: [GeneralCommandType.Play, GeneralCommandType.DisplayContent, GeneralCommandType.DisplayMessage]
|
||||
supportedCommands: [GeneralCommandType.Play, GeneralCommandType.DisplayMessage]
|
||||
}
|
||||
|
||||
PlatformMediaControl {
|
||||
|
@ -80,7 +80,8 @@ ApplicationWindow {
|
|||
//cover: CoverBackground {CoverPlaceholder { icon.source: "icon.png"; text: "Sailfin"}}
|
||||
cover: {
|
||||
// Disabled due to buggy Loader behaviour
|
||||
if ([MediaPlayer.NoMedia, MediaPlayer.InvalidMedia, MediaPlayer.UnknownStatus].indexOf(_playbackManager.mediaStatus) >= 0) {
|
||||
if ([MediaPlayer.NoMedia, MediaPlayer.InvalidMedia, MediaPlayer.UnknownStatus].indexOf(_playbackManager.mediaStatus) >= 0
|
||||
|| _playbackManager.playbackState === MediaPlayer.StoppedState) {
|
||||
return Qt.resolvedUrl("cover/CollectionPage.qml")
|
||||
} else {
|
||||
return Qt.resolvedUrl("cover/NowPlayingCover.qml")
|
||||
|
@ -155,6 +156,14 @@ ApplicationWindow {
|
|||
property bool showDebugInfo: false
|
||||
}
|
||||
|
||||
function navigateToItem(jellyfinId, mediaType, type, isFolder) {
|
||||
if (mediaType === "Audio") {
|
||||
playbackManager.playItemId(jellyfinId)
|
||||
} else {
|
||||
pageStack.push(Utils.getPageUrl(mediaType, type, isFolder), {"itemId": jellyfinId});
|
||||
}
|
||||
}
|
||||
|
||||
//FIXME: proper error handling
|
||||
Connections {
|
||||
target: apiClient
|
||||
|
|
|
@ -95,7 +95,7 @@ Page {
|
|||
id: userResumeLoader
|
||||
apiClient: appWindow.apiClient
|
||||
limit: 12
|
||||
//recursive: true*/
|
||||
//recursive: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,8 +127,7 @@ Page {
|
|||
MoreSection {
|
||||
text: model.name
|
||||
busy: userItemModel.status !== J.UsersViewsLoader.Ready
|
||||
|
||||
onHeaderClicked: pageStack.push(Qt.resolvedUrl("itemdetails/CollectionPage.qml"), {"itemId": model.jellyfinId})
|
||||
onHeaderClicked: appWindow.navigateToItem(model.jellyfinId, model.mediaType, model.type, model.isFolder);
|
||||
Loader {
|
||||
width: parent.width
|
||||
sourceComponent: carrouselView
|
||||
|
@ -232,7 +231,7 @@ Page {
|
|||
progress: (typeof model.userDataPlayedProgress !== 0.0) ? model.userDataPlayedPercentage / 100 : 0.0
|
||||
|
||||
onClicked: {
|
||||
pageStack.push(Utils.getPageUrl(model.mediaType, model.type, model.isFolder), {"itemId": model.jellyfinId, "itemData": model.qtObject})
|
||||
appWindow.navigateToItem(model.jellyfinId, model.mediaType, model.type, model.isFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ BaseDetailPage {
|
|||
text: qsTr("Sort by")
|
||||
onClicked: pageStack.push(sortPageComponent)
|
||||
}
|
||||
busy: collectionModel.status === J.UserItemsLoader.Loading
|
||||
busy: collectionModel.status === J.ModelStatus.Loading
|
||||
}
|
||||
delegate: GridItem {
|
||||
RemoteImage {
|
||||
|
@ -94,7 +94,7 @@ BaseDetailPage {
|
|||
horizontalAlignment: Text.AlignLeft
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
}
|
||||
onClicked: pageStack.push(Utils.getPageUrl(model.mediaType, model.type, model.isFolder), {"itemId": model.jellyfinId})
|
||||
onClicked: appWindow.navigateToItem(model.jellyfinId, model.mediaType, model.type, model.isFolder);
|
||||
}
|
||||
|
||||
ViewPlaceholder {
|
||||
|
|
|
@ -144,7 +144,7 @@ BaseDetailPage {
|
|||
wrapMode: Text.WordWrap
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
onClicked: pageStack.push(Utils.getPageUrl(model.mediaType, model.type), {"itemId": model.jellyfinId})
|
||||
onClicked: appWindow.navigateToItem(model.jellyfinId, model.mediaType, model.type, model.isFolder);
|
||||
}
|
||||
|
||||
VerticalScrollDecorator {}
|
||||
|
|
|
@ -90,7 +90,7 @@ BaseDetailPage {
|
|||
poster: Utils.itemModelImageUrl(apiClient.baseUrl, model.jellyfinId, model.imageTags.Primary, "Primary", {"maxHeight": height})
|
||||
blurhash: model.imageBlurHashes["Primary"][model.imageTags.Primary]
|
||||
title: model.name
|
||||
onClicked: pageStack.push(Utils.getPageUrl(model.mediaType, model.type), {"itemId": model.jellyfinId})
|
||||
onClicked: appWindow.navigateToItem(model.jellyfinId, model.mediaType, model.type, model.isFolder);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue