Commit 683ceab3 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

restart android UI and import plasma mobile components

not yet doing much but starting to try plasma mobile components
parents
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.2
import QtQuick.Window 2.2
Item {
id: viewAlbumDelegate
property string title
property string artist
property string itemDecoration
property string duration
property int trackRating
property bool isPlaying
property bool showHoverButtons
property int itemIndex
signal remove(int indexToRemove)
RowLayout {
width: parent.width
height: parent.height
spacing: 0
ColumnLayout {
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
spacing: 0
Item {
Layout.preferredHeight: 1
Layout.minimumHeight: 1
Layout.maximumHeight: 1
}
Image {
id: mainIcon
source: itemDecoration
Layout.preferredWidth: parent.height - 2
Layout.preferredHeight: parent.height - 2
width: parent.height - 2
sourceSize.width: width
sourceSize.height: width
fillMode: Image.PreserveAspectFit
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Button {
id: removeButton
iconName: 'list-remove'
anchors.fill: parent
visible: showHoverButtons
opacity: 0.8
enabled: true
onClicked: remove(itemIndex)
}
}
Item {
Layout.preferredHeight: 1
Layout.minimumHeight: 1
Layout.maximumHeight: 1
}
}
ColumnLayout {
Layout.preferredWidth: Screen.pixelDensity * 3.
Layout.preferredHeight: viewAlbumDelegate.height
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
spacing: 0
Item {
Layout.preferredHeight: Screen.pixelDensity * 4.
Layout.minimumHeight: Screen.pixelDensity * 4.
Layout.maximumHeight: Screen.pixelDensity * 4.
}
Label {
id: mainLabel
text: title
Layout.preferredWidth: Screen.pixelDensity * 12
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
elide: "ElideRight"
}
Item {
Layout.fillHeight: true
}
Label {
id: authorLabel
text: artist + ' - ' + album
Layout.preferredWidth: Screen.pixelDensity * 3
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
elide: "ElideRight"
}
Item {
Layout.preferredHeight: Screen.pixelDensity * 4.
Layout.minimumHeight: Screen.pixelDensity * 4.
Layout.maximumHeight: Screen.pixelDensity * 4.
}
}
Image {
id: playIcon
source: 'image://icon/media-playback-start'
Layout.preferredWidth: parent.height * 0.5
Layout.preferredHeight: parent.height * 0.5
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.maximumWidth: parent.height * 0.7
Layout.maximumHeight: parent.height * 0.7
width: parent.height * 0.7
height: parent.height * 0.7
sourceSize.width: width
sourceSize.height: width
fillMode: Image.PreserveAspectFit
visible: isPlaying
}
Item {
Layout.preferredWidth: width
Layout.minimumWidth: width
Layout.maximumWidth: width
width: Screen.pixelDensity * 12
}
ColumnLayout {
Layout.preferredHeight: viewAlbumDelegate.height
Layout.minimumHeight: viewAlbumDelegate.height
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
spacing: 0
Item {
Layout.preferredHeight: Screen.pixelDensity * 3.
Layout.minimumHeight: Screen.pixelDensity * 3.
Layout.maximumHeight: Screen.pixelDensity * 3.
}
Label {
id: durationLabel
text: duration
elide: "ElideRight"
Layout.alignment: Qt.AlignRight
}
Item {
Layout.fillHeight: true
}
RatingStar {
id: mainRating
starSize: 20
starRating: trackRating
Layout.alignment: Qt.AlignRight
}
Item {
Layout.preferredHeight: Screen.pixelDensity * 3.
Layout.minimumHeight: Screen.pixelDensity * 3.
Layout.maximumHeight: Screen.pixelDensity * 3.
}
}
Item {
Layout.preferredWidth: Screen.pixelDensity * 6.
Layout.minimumWidth: Screen.pixelDensity * 6.
Layout.maximumWidth: Screen.pixelDensity * 6.
}
}
}
import QtQuick 2.2
import QtQuick.Window 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QtQuick.Layouts 1.1
Item {
id: viewAlbumDelegate
property string title
property string artist
property string itemDecoration
property string duration
property int trackRating
property bool isPlaying
RowLayout {
width: parent.width
height: parent.height
spacing: 0
Image {
id: mainIcon
source: itemDecoration
Layout.preferredWidth: parent.height * 0.9
Layout.preferredHeight: parent.height * 0.9
width: parent.height * 0.9
height: parent.height * 0.9
sourceSize.width: width
sourceSize.height: width
fillMode: Image.PreserveAspectFit
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
}
ColumnLayout {
Layout.preferredWidth: Screen.pixelDensity * 2
Layout.preferredHeight: viewAlbumDelegate.height
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
spacing: 0
Item {
Layout.preferredHeight: Screen.pixelDensity * 2
Layout.minimumHeight: Screen.pixelDensity * 2
Layout.maximumHeight: Screen.pixelDensity * 2
}
Label {
id: mainLabel
text: title
Layout.preferredWidth: Screen.pixelDensity * 25
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
elide: "ElideRight"
}
Item {
Layout.fillHeight: true
}
Label {
id: authorLabel
text: artist
Layout.preferredWidth: Screen.pixelDensity * 20
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
elide: "ElideRight"
}
Item {
Layout.preferredHeight: Screen.pixelDensity * 2
Layout.minimumHeight: Screen.pixelDensity * 2
Layout.maximumHeight: Screen.pixelDensity * 2
}
}
Image {
id: playIcon
source: 'qrc:/audio-x-generic.svg'
Layout.preferredWidth: parent.height * 0.5
Layout.preferredHeight: parent.height * 0.5
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.maximumWidth: parent.height * 0.7
Layout.maximumHeight: parent.height * 0.7
width: parent.height * 0.7
height: parent.height * 0.7
sourceSize.width: width
sourceSize.height: width
fillMode: Image.PreserveAspectFit
visible: isPlaying
}
Item {
Layout.preferredWidth: width
Layout.minimumWidth: width
Layout.maximumWidth: width
width: Screen.pixelDensity * 5
}
ColumnLayout {
Layout.preferredHeight: viewAlbumDelegate.height
Layout.minimumHeight: viewAlbumDelegate.height
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
spacing: 0
Item {
Layout.preferredHeight: Screen.pixelDensity * 2
Layout.minimumHeight: Screen.pixelDensity * 2
Layout.maximumHeight: Screen.pixelDensity * 2
}
Label {
id: durationLabel
text: duration
elide: "ElideRight"
Layout.alignment: Qt.AlignRight
}
Item {
Layout.fillHeight: true
}
RatingStar {
id: mainRating
starSize: 20
starRating: trackRating
Layout.alignment: Qt.AlignRight
}
Item {
Layout.preferredHeight: Screen.pixelDensity * 2
Layout.minimumHeight: Screen.pixelDensity * 2
Layout.maximumHeight: Screen.pixelDensity * 2
}
}
Item {
Layout.preferredWidth: Screen.pixelDensity * 4
Layout.minimumWidth: Screen.pixelDensity * 4
Layout.maximumWidth: Screen.pixelDensity * 4
}
}
}
include_directories(${upnp-qt_BINARY_DIR})
set(upnpControl_SOURCES
upnpControl.cpp
mediaplaylist.cpp
playlistcontroler.cpp
viewpagesmodel.cpp
remoteserverentry.cpp
upnpControl.qml
MediaServer.qml
genericDevice.qml
MediaServerListing.qml
MediaAlbumView.qml
RatingStar.qml
AudioTrackDelegate.qml
MediaPlayerControl.qml
MediaServerEntry.qml
MediaContentDirectory.qml
MediaPlayListView.qml
HeaderBar.qml
MediaServerMobile.qml
AudioTrackDelegateMobile.qml
genericDeviceMobile.qml
upnpControlMobile.qml
mediaServerMobile.qml
mediaServerListingMobile.qml
mediaAlbumViewMobile.qml
MediaPlayerControlMobile.qml
MediaServerEntryMobile.qml
MediaContentDirectoryMobile.qml
../mobilecomponents/qml/ActionGroup.qml
../mobilecomponents/qml/GlobalDrawer.qml
../mobilecomponents/qml/Label.qml
../mobilecomponents/qml/OverlayDrawer.qml
../mobilecomponents/qml/SplitDrawer.qml
../mobilecomponents/qml/ApplicationWindow.qml
../mobilecomponents/qml/Heading.qml
../mobilecomponents/qml/ListItem.qml
../mobilecomponents/qml/Page.qml
../mobilecomponents/qml/ContextDrawer.qml
../mobilecomponents/qml/IconGrid.qml
../mobilecomponents/qml/ListItemWithActions.qml
../mobilecomponents/qml/PageRow.qml
)
qt5_add_resources(upnpControl_SOURCES upnpControl.qrc)
add_executable(upnpControl ${upnpControl_SOURCES})
target_include_directories(upnpControl PRIVATE ${KDSoap_INCLUDE_DIRS})
target_link_libraries(upnpControl
LINK_PRIVATE
upnpQt
Qt5::Quick
Qt5::Widgets
)
if (${KF5Declarative_FOUND})
target_link_libraries(upnpControl
LINK_PRIVATE
KF5::Declarative
)
endif()
import QtQuick 2.0
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.2
import QtQuick.Window 2.2
Item {
id: headerBar
property string title
property string artist
property string album
property string image
property string tracksCount
property int trackRating
property bool ratingVisible
ColumnLayout {
width: parent.width
height: parent.height
spacing: 0
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
RowLayout {
spacing: 0
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: Screen.pixelDensity * 20.
Layout.minimumHeight: Screen.pixelDensity * 20.
Layout.maximumHeight: Screen.pixelDensity * 20.
Layout.fillWidth: true
Item {
Layout.preferredWidth: Screen.pixelDensity * 50.
Layout.minimumWidth: Screen.pixelDensity * 50.
Layout.maximumWidth: Screen.pixelDensity * 50.
Layout.fillHeight: true
}
Image {
id: mainIcon
source: image
fillMode: Image.PreserveAspectFit
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredHeight: Screen.pixelDensity * 20.
Layout.minimumHeight: Screen.pixelDensity * 20.
Layout.maximumHeight: Screen.pixelDensity * 20.
Layout.preferredWidth: Screen.pixelDensity * 20.
Layout.minimumWidth: Screen.pixelDensity * 20.
Layout.maximumWidth: Screen.pixelDensity * 20.
}
Item {
Layout.preferredWidth: Screen.pixelDensity * 2.
Layout.minimumWidth: Screen.pixelDensity * 2.
Layout.maximumWidth: Screen.pixelDensity * 2.
Layout.fillHeight: true
}
ColumnLayout {
spacing: 0
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredWidth: Screen.pixelDensity * 80.
Layout.minimumWidth: Screen.pixelDensity * 80.
Layout.maximumWidth: Screen.pixelDensity * 80.
Layout.fillHeight: true
Item {
Layout.fillHeight: true
}
Label {
id: mainLabel
text: title
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
elide: "ElideRight"
}
Item {
Layout.fillHeight: true
}
Label {
id: authorLabel
text: artist
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
elide: "ElideRight"
}
Item {
Layout.fillHeight: true
}
Label {
id: albumLabel
text: album
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft
elide: "ElideRight"
}
Item {
Layout.fillHeight: true
}
RatingStar {
id: mainRating
visible: ratingVisible
starSize: 20
starRating: trackRating
Layout.alignment: Qt.AlignLeft
}
Item {
Layout.fillHeight: true
}
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
Label {
id: remainingTracksLabel
text: tracksCount + ' tracks remaining'
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
elide: "ElideRight"
visible: tracksCount > 0
}
Item {
Layout.preferredWidth: Screen.pixelDensity * 40.
Layout.minimumWidth: Screen.pixelDensity * 40.
Layout.maximumWidth: Screen.pixelDensity * 40.
Layout.fillHeight: true
}
}
Item {
Layout.fillHeight: true
Layout.fillWidth: true
}
}
}
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtQml.Models 2.1
import org.mgallien.QmlExtension 1.0
import QtMultimedia 5.4
Item {
property UpnpControlContentDirectory contentDirectoryService
property string rootId
property StackView stackView
property UpnpContentDirectoryModel contentModel
property MediaPlayList playListModel
width: stackView.width
height: stackView.height
Component {
id: rowDelegate
Item {
id: rowDelegateContent
height: Screen.pixelDensity * 15.
Rectangle {
color: "#FFFFFF"
anchors.fill: parent
}
}
}
ColumnLayout {
anchors.fill: parent
spacing: 0
TableView {
id: contentDirectoryView
model: DelegateModel {
model: contentModel
rootIndex: contentModel.indexFromId(rootId)
delegate: AudioTrackDelegate {
height: Screen.pixelDensity * 15.
width: contentDirectoryView.width
title: if (model != undefined && model.title !== undefined)
model.title
else
''
artist: if (model != undefined && model.artist !== undefined)
model.artist
else
''
itemDecoration: if (model != undefined && model.image !== undefined)
model.image
else
''
duration: if (model != undefined && model.duration !== undefined)
model.duration
else
''
trackRating: if (model != undefined && model.rating !== undefined)
model.rating
else
''
isPlaying: if (model != undefined && model.isPlaying !== undefined)
model.isPlaying
else
false
}
}