mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-12-23 06:25:17 +00:00
caf72af999
* Show the now playing cover when playing an item, otherwise show the collection cover. * ItemModelLoaders now correctly expose list properties of non-built-in Qt objects * toString is now implemented for lists, fixing some query construction code. * PlaybackManager now clears the playlist when playing a single item to prevent weird behaviour. * The covers are slightly updated.
87 lines
2.8 KiB
QML
87 lines
2.8 KiB
QML
/*
|
|
Sailfin: a Jellyfin client written using Qt
|
|
Copyright (C) 2020 Chris Josten
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with this library; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
*/
|
|
|
|
import QtQuick 2.6
|
|
import Sailfish.Silica 1.0
|
|
|
|
import nl.netsoj.chris.Jellyfin 1.0 as J
|
|
|
|
import "../components"
|
|
import ".."
|
|
|
|
CoverBackground {
|
|
// Due QTBUG-10822, declarartions such as `property J.Item foo` are not possible.
|
|
property var mData: appWindow.playbackManager.item
|
|
RemoteImage {
|
|
anchors.fill: parent
|
|
source: mData === null ? "" : Utils.itemImageUrl(appWindow.apiClient.baseUrl, mData, "Primary", {"maxWidth": parent.width})
|
|
fillMode: Image.PreserveAspectCrop
|
|
onSourceChanged: console.log(source)
|
|
}
|
|
|
|
Shim {
|
|
// Movies usually show their name on the poster,
|
|
// so showing it here as well is a bit double
|
|
visible: mData.type !== "Movie"
|
|
anchors {
|
|
left: parent.left
|
|
right: parent.right
|
|
top: parent.top
|
|
}
|
|
upsideDown: true
|
|
height: parent.height / 2
|
|
|
|
Rectangle {
|
|
anchors {
|
|
top: parent.top
|
|
left: parent.left
|
|
}
|
|
width: itemData.userData.playedPercentage / 100 * parent.width
|
|
height: Theme.paddingSmall
|
|
color: Theme.highlightColor
|
|
}
|
|
|
|
Column {
|
|
id: infoColumn
|
|
anchors {
|
|
top: parent.top
|
|
left: parent.left
|
|
right: parent.right
|
|
}
|
|
anchors.margins: Theme.paddingMedium
|
|
Label {
|
|
id: itemName
|
|
anchors {
|
|
left: parent.left
|
|
right: parent.right
|
|
}
|
|
color: Theme.primaryColor
|
|
text: mData.name
|
|
truncationMode: TruncationMode.Fade
|
|
}
|
|
Label {
|
|
visible: typeof mData.runTimeTicks !== "undefined"
|
|
color: Theme.secondaryColor
|
|
text: qsTr("%1/%2").arg(Utils.timeToText(appWindow.playbackManager.position)).arg(Utils.ticksToText(mData.runTimeTicks))
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|