1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-11-25 02:15:17 +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:
Chris Josten 2021-09-10 03:08:40 +02:00
parent 5d521ee189
commit 40d8a58a5a
No known key found for this signature in database
GPG key ID: A69C050E9FD9FF6A
7 changed files with 35 additions and 17 deletions

View file

@ -91,7 +91,9 @@ ApplicationWindow {
color: "white" color: "white"
} }
Text { 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" color: "white"
} }
} }

View file

@ -325,10 +325,10 @@ PanelBackground {
} }
PropertyChanges { PropertyChanges {
target: previousButton; opacity: 1; enabled: true; target: previousButton; opacity: 1; enabled: playbackManager.hasPrevious;
} }
PropertyChanges { PropertyChanges {
target: nextButton; opacity: 1; enabled: true; target: nextButton; opacity: 1; enabled: playbackManager.hasNext;
} }
PropertyChanges { PropertyChanges {
target: playModeButton; opacity: 1; enabled: true; target: playModeButton; opacity: 1; enabled: true;
@ -423,16 +423,24 @@ PanelBackground {
allowedOrientations: appWindow.allowedOrientations allowedOrientations: appWindow.allowedOrientations
SilicaFlickable { SilicaFlickable {
anchors.fill: parent anchors.fill: parent
/*PullDownMenu { PullDownMenu {
MenuItem { /*MenuItem {
//: Pulley menu item to view detailed media information of a song //: Pulley menu item to view detailed media information of a song
text: qsTr("Info") text: qsTr("Info")
} }
MenuItem { MenuItem {
//: Pulley menu item: add music to a playlist //: Pulley menu item: add music to a playlist
text: qsTr("Add to playlist") text: qsTr("Add to playlist")
}
}*/ }*/
MenuItem {
//: Pulley menu item: stops playback of music
text: qsTr("Stop")
onClicked: {
playbackManager.stop()
pageStack.pop()
}
}
}
Loader { Loader {
Component.onCompleted: setSource(Qt.resolvedUrl("PlaybackBar.qml"), Component.onCompleted: setSource(Qt.resolvedUrl("PlaybackBar.qml"),
{"isFullPage": true, "manager": manager, "y": 0}) {"isFullPage": true, "manager": manager, "y": 0})

View file

@ -28,7 +28,7 @@ import Nemo.KeepAlive 1.2
import "components" import "components"
import "pages" import "pages"
import "." as D import "."
ApplicationWindow { ApplicationWindow {
id: appWindow id: appWindow
@ -50,7 +50,7 @@ ApplicationWindow {
ApiClient { ApiClient {
id: _apiClient id: _apiClient
objectName: "Test" objectName: "Test"
supportedCommands: [GeneralCommandType.Play, GeneralCommandType.DisplayContent, GeneralCommandType.DisplayMessage] supportedCommands: [GeneralCommandType.Play, GeneralCommandType.DisplayMessage]
} }
PlatformMediaControl { PlatformMediaControl {
@ -80,7 +80,8 @@ ApplicationWindow {
//cover: CoverBackground {CoverPlaceholder { icon.source: "icon.png"; text: "Sailfin"}} //cover: CoverBackground {CoverPlaceholder { icon.source: "icon.png"; text: "Sailfin"}}
cover: { cover: {
// Disabled due to buggy Loader behaviour // 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") return Qt.resolvedUrl("cover/CollectionPage.qml")
} else { } else {
return Qt.resolvedUrl("cover/NowPlayingCover.qml") return Qt.resolvedUrl("cover/NowPlayingCover.qml")
@ -155,6 +156,14 @@ ApplicationWindow {
property bool showDebugInfo: false 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 //FIXME: proper error handling
Connections { Connections {
target: apiClient target: apiClient

View file

@ -95,7 +95,7 @@ Page {
id: userResumeLoader id: userResumeLoader
apiClient: appWindow.apiClient apiClient: appWindow.apiClient
limit: 12 limit: 12
//recursive: true*/ //recursive: true
} }
} }
} }
@ -127,8 +127,7 @@ Page {
MoreSection { MoreSection {
text: model.name text: model.name
busy: userItemModel.status !== J.UsersViewsLoader.Ready busy: userItemModel.status !== J.UsersViewsLoader.Ready
onHeaderClicked: appWindow.navigateToItem(model.jellyfinId, model.mediaType, model.type, model.isFolder);
onHeaderClicked: pageStack.push(Qt.resolvedUrl("itemdetails/CollectionPage.qml"), {"itemId": model.jellyfinId})
Loader { Loader {
width: parent.width width: parent.width
sourceComponent: carrouselView sourceComponent: carrouselView
@ -232,7 +231,7 @@ Page {
progress: (typeof model.userDataPlayedProgress !== 0.0) ? model.userDataPlayedPercentage / 100 : 0.0 progress: (typeof model.userDataPlayedProgress !== 0.0) ? model.userDataPlayedPercentage / 100 : 0.0
onClicked: { 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);
} }
} }
} }

View file

@ -58,7 +58,7 @@ BaseDetailPage {
text: qsTr("Sort by") text: qsTr("Sort by")
onClicked: pageStack.push(sortPageComponent) onClicked: pageStack.push(sortPageComponent)
} }
busy: collectionModel.status === J.UserItemsLoader.Loading busy: collectionModel.status === J.ModelStatus.Loading
} }
delegate: GridItem { delegate: GridItem {
RemoteImage { RemoteImage {
@ -94,7 +94,7 @@ BaseDetailPage {
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
font.pixelSize: Theme.fontSizeSmall 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 { ViewPlaceholder {

View file

@ -144,7 +144,7 @@ BaseDetailPage {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
elide: Text.ElideRight 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 {} VerticalScrollDecorator {}

View file

@ -90,7 +90,7 @@ BaseDetailPage {
poster: Utils.itemModelImageUrl(apiClient.baseUrl, model.jellyfinId, model.imageTags.Primary, "Primary", {"maxHeight": height}) poster: Utils.itemModelImageUrl(apiClient.baseUrl, model.jellyfinId, model.imageTags.Primary, "Primary", {"maxHeight": height})
blurhash: model.imageBlurHashes["Primary"][model.imageTags.Primary] blurhash: model.imageBlurHashes["Primary"][model.imageTags.Primary]
title: model.name 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);
} }
} }