Restructured the way item "details" are loaded
Previously, Items were displayed in one page, named DetailPage.qml.
This page then would load a qml component, based on the page type. It
also contained some components common for each detail page, like
displaying the name of the item. This construction had as downside that
modifying the page properties, adding a pulley menu or basing the page
around a SilicaListview was not possible. So I already had created some
other pages.
The new construction uses a base page, named BaseDetailPage which does
set some common properties and handle the loading of the items, so that
that part does not have to be duplicated. Displaying the name of an item
was a very trivial thing to do, so duplicating that part across files
was not a problem. Anyway, the rest of the pages are now seperate, but
all have BaseDetailsPage as the root, so they can use the common
functionality by that page. Those subpages now can be based around
GridViews, Carrousels, have pully menus and so on. To determine to which
page to go to, based on the content type, a function named getPageUrl
has been added to Utils.js, which takes a content type as argument and
gives the page url back.
2020-09-29 00:15:50 +00:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
|
|
|
|
Column {
|
|
|
|
property alias imageSource : playImage.source
|
|
|
|
property real imageAspectRatio: 1.0
|
2020-10-01 19:45:34 +00:00
|
|
|
property real playProgress: 0.0
|
2020-10-09 00:33:08 +00:00
|
|
|
property bool favourited: false
|
2021-02-12 02:32:28 +00:00
|
|
|
property alias imageBlurhash: playImage.blurhash
|
2021-02-13 23:21:49 +00:00
|
|
|
signal playPressed(bool resume)
|
Restructured the way item "details" are loaded
Previously, Items were displayed in one page, named DetailPage.qml.
This page then would load a qml component, based on the page type. It
also contained some components common for each detail page, like
displaying the name of the item. This construction had as downside that
modifying the page properties, adding a pulley menu or basing the page
around a SilicaListview was not possible. So I already had created some
other pages.
The new construction uses a base page, named BaseDetailPage which does
set some common properties and handle the loading of the items, so that
that part does not have to be duplicated. Displaying the name of an item
was a very trivial thing to do, so duplicating that part across files
was not a problem. Anyway, the rest of the pages are now seperate, but
all have BaseDetailsPage as the root, so they can use the common
functionality by that page. Those subpages now can be based around
GridViews, Carrousels, have pully menus and so on. To determine to which
page to go to, based on the content type, a function named getPageUrl
has been added to Utils.js, which takes a content type as argument and
gives the page url back.
2020-09-29 00:15:50 +00:00
|
|
|
spacing: Theme.paddingLarge
|
|
|
|
|
|
|
|
BackgroundItem {
|
|
|
|
width: parent.width
|
|
|
|
height: width / imageAspectRatio
|
2021-02-12 02:32:28 +00:00
|
|
|
RemoteImage {
|
Restructured the way item "details" are loaded
Previously, Items were displayed in one page, named DetailPage.qml.
This page then would load a qml component, based on the page type. It
also contained some components common for each detail page, like
displaying the name of the item. This construction had as downside that
modifying the page properties, adding a pulley menu or basing the page
around a SilicaListview was not possible. So I already had created some
other pages.
The new construction uses a base page, named BaseDetailPage which does
set some common properties and handle the loading of the items, so that
that part does not have to be duplicated. Displaying the name of an item
was a very trivial thing to do, so duplicating that part across files
was not a problem. Anyway, the rest of the pages are now seperate, but
all have BaseDetailsPage as the root, so they can use the common
functionality by that page. Those subpages now can be based around
GridViews, Carrousels, have pully menus and so on. To determine to which
page to go to, based on the content type, a function named getPageUrl
has been added to Utils.js, which takes a content type as argument and
gives the page url back.
2020-09-29 00:15:50 +00:00
|
|
|
id: playImage
|
|
|
|
anchors.fill: parent
|
|
|
|
fillMode: Image.PreserveAspectCrop
|
|
|
|
clip: true
|
|
|
|
}
|
2020-10-01 22:13:05 +00:00
|
|
|
Rectangle {
|
|
|
|
anchors.fill: parent
|
|
|
|
color: Theme.rgba(Theme.overlayBackgroundColor, Theme.opacityLow)
|
|
|
|
}
|
Restructured the way item "details" are loaded
Previously, Items were displayed in one page, named DetailPage.qml.
This page then would load a qml component, based on the page type. It
also contained some components common for each detail page, like
displaying the name of the item. This construction had as downside that
modifying the page properties, adding a pulley menu or basing the page
around a SilicaListview was not possible. So I already had created some
other pages.
The new construction uses a base page, named BaseDetailPage which does
set some common properties and handle the loading of the items, so that
that part does not have to be duplicated. Displaying the name of an item
was a very trivial thing to do, so duplicating that part across files
was not a problem. Anyway, the rest of the pages are now seperate, but
all have BaseDetailsPage as the root, so they can use the common
functionality by that page. Those subpages now can be based around
GridViews, Carrousels, have pully menus and so on. To determine to which
page to go to, based on the content type, a function named getPageUrl
has been added to Utils.js, which takes a content type as argument and
gives the page url back.
2020-09-29 00:15:50 +00:00
|
|
|
Icon {
|
|
|
|
id: playButton
|
|
|
|
source: "image://theme/icon-l-play"
|
|
|
|
anchors.centerIn: parent
|
|
|
|
highlighted: parent.highlighted
|
|
|
|
}
|
2020-10-01 19:45:34 +00:00
|
|
|
Rectangle {
|
|
|
|
anchors {
|
|
|
|
left: parent.left
|
|
|
|
bottom: parent.bottom
|
|
|
|
}
|
|
|
|
height: Theme.paddingMedium
|
|
|
|
color: Theme.highlightColor
|
|
|
|
width: parent.width * playProgress
|
|
|
|
}
|
2021-02-13 23:21:49 +00:00
|
|
|
onClicked: playPressed(true)
|
Restructured the way item "details" are loaded
Previously, Items were displayed in one page, named DetailPage.qml.
This page then would load a qml component, based on the page type. It
also contained some components common for each detail page, like
displaying the name of the item. This construction had as downside that
modifying the page properties, adding a pulley menu or basing the page
around a SilicaListview was not possible. So I already had created some
other pages.
The new construction uses a base page, named BaseDetailPage which does
set some common properties and handle the loading of the items, so that
that part does not have to be duplicated. Displaying the name of an item
was a very trivial thing to do, so duplicating that part across files
was not a problem. Anyway, the rest of the pages are now seperate, but
all have BaseDetailsPage as the root, so they can use the common
functionality by that page. Those subpages now can be based around
GridViews, Carrousels, have pully menus and so on. To determine to which
page to go to, based on the content type, a function named getPageUrl
has been added to Utils.js, which takes a content type as argument and
gives the page url back.
2020-09-29 00:15:50 +00:00
|
|
|
}
|
|
|
|
Row {
|
|
|
|
anchors {
|
|
|
|
//left: parent.left
|
|
|
|
right: parent.right
|
|
|
|
leftMargin: Theme.horizontalPageMargin
|
|
|
|
rightMargin: Theme.horizontalPageMargin
|
|
|
|
}
|
|
|
|
spacing: Theme.paddingMedium
|
2020-10-01 19:45:34 +00:00
|
|
|
IconButton {
|
|
|
|
id: playFromBeginning
|
|
|
|
icon.source: "image://theme/icon-m-backup"
|
|
|
|
visible: playProgress > 0
|
2021-02-13 23:21:49 +00:00
|
|
|
onClicked: playPressed(false)
|
2020-10-01 19:45:34 +00:00
|
|
|
}
|
Restructured the way item "details" are loaded
Previously, Items were displayed in one page, named DetailPage.qml.
This page then would load a qml component, based on the page type. It
also contained some components common for each detail page, like
displaying the name of the item. This construction had as downside that
modifying the page properties, adding a pulley menu or basing the page
around a SilicaListview was not possible. So I already had created some
other pages.
The new construction uses a base page, named BaseDetailPage which does
set some common properties and handle the loading of the items, so that
that part does not have to be duplicated. Displaying the name of an item
was a very trivial thing to do, so duplicating that part across files
was not a problem. Anyway, the rest of the pages are now seperate, but
all have BaseDetailsPage as the root, so they can use the common
functionality by that page. Those subpages now can be based around
GridViews, Carrousels, have pully menus and so on. To determine to which
page to go to, based on the content type, a function named getPageUrl
has been added to Utils.js, which takes a content type as argument and
gives the page url back.
2020-09-29 00:15:50 +00:00
|
|
|
IconButton {
|
|
|
|
id: favouriteButton
|
2020-10-09 00:33:08 +00:00
|
|
|
icon.source: favourited ? "image://theme/icon-m-favorite-selected"
|
|
|
|
: "image://theme/icon-m-favorite"
|
Restructured the way item "details" are loaded
Previously, Items were displayed in one page, named DetailPage.qml.
This page then would load a qml component, based on the page type. It
also contained some components common for each detail page, like
displaying the name of the item. This construction had as downside that
modifying the page properties, adding a pulley menu or basing the page
around a SilicaListview was not possible. So I already had created some
other pages.
The new construction uses a base page, named BaseDetailPage which does
set some common properties and handle the loading of the items, so that
that part does not have to be duplicated. Displaying the name of an item
was a very trivial thing to do, so duplicating that part across files
was not a problem. Anyway, the rest of the pages are now seperate, but
all have BaseDetailsPage as the root, so they can use the common
functionality by that page. Those subpages now can be based around
GridViews, Carrousels, have pully menus and so on. To determine to which
page to go to, based on the content type, a function named getPageUrl
has been added to Utils.js, which takes a content type as argument and
gives the page url back.
2020-09-29 00:15:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|