Commit b16f1e5b authored by kempe's avatar kempe
Browse files

#11 Redesigned player controls show track information

parent 040a9e83
......@@ -54,7 +54,8 @@ DISTFILES += \
qml/pages/StationsPageForm.ui.qml \
qml/pages/StationsPage.qml \
qml/harbour-received.qml \
qml/cover/layouts/CoverDesign.qml
qml/cover/layouts/CoverDesign.qml \
qml/components/audioplayer/StationInfoLabel.qml
OTHER_FILES += \
rpm/harbour-received.changes.in \
......
......@@ -19,6 +19,7 @@ DockedAudioPlayerForm {
isPlaying: AudioPlayer.isPlaying
showProgressBar: AudioPlayer.isLoading || AudioPlayer.isBuffering
bufferProgress: AudioPlayer.bufferProgress
currentTrack: AudioPlayer.title
// Triggers
......
import QtQuick 2.6
import QtQuick.Layouts 1.1
import Sailfish.Silica 1.0
import "../"
......@@ -20,12 +21,11 @@ DockedPanel {
property bool isPlaying: false
property bool isFavorite: false
property int bufferProgress: 0
property string currentTrack: ""
property var stationData
height: Theme.itemSizeExtraLarge + Theme.paddingLarge
contentHeight: height
flickableDirection: Flickable.VerticalFlick
SleepTimer {
......@@ -40,56 +40,53 @@ DockedPanel {
anchors.fill: parent
}
Row {
RowLayout {
id: quickControlsItem
anchors.fill: parent
spacing: Theme.paddingLarge
anchors.margins: Theme.paddingSmall
Image {
id: stationIcon
sourceSize.height: parent.height
sourceSize.width: player.height
source: window.stationIcon
Layout.minimumWidth: parent.height - Theme.paddingSmall
Layout.minimumHeight: parent.height - Theme.paddingSmall
source: window.stationIcon
smooth: true
fillMode: Image.PreserveAspectFit
cache: true
fillMode: Image.PreserveAspectFit
sourceSize.height: height
sourceSize.width: height
}
Column {
ColumnLayout {
id: trackInfo
width: parent.width - stationIcon.width - Theme.paddingLarge
height: parent.height
spacing: -Theme.paddingSmall
Label {
width: parent.width
truncationMode: TruncationMode.Fade
text: stationData ? stationData.name : ""
}
Label {
width: parent.width
font.pixelSize: Theme.fontSizeSmall
truncationMode: TruncationMode.Fade
color: Theme.secondaryColor
text: stationData ? stationData.genre : "";
StationInfoLabel {
name: stationData ? stationData.name : ""
track: currentTrack
Layout.fillHeight: true
Layout.fillWidth: true
}
ProgressBar {
id: progressBar
value: bufferProgress
width: parent.width
visible: showProgressBar
Layout.fillWidth: true
}
PlayerControlsForm {
id: controls
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
visible: !showProgressBar
isPlaying: player.isPlaying
isStared: player.isFavorite
Layout.fillWidth: true
}
}
}
......
import QtQuick 2.0
import QtQuick.Layouts 1.1
import Sailfish.Silica 1.0
ColumnLayout {
id: stationInfoLabel
spacing: 0
property alias name: nameText.text
property alias track: trackText.text
Label {
id: nameText
color: Theme.highlightColor
font.pixelSize: Theme.fontSizeSmall
horizontalAlignment: Text.AlignLeft
truncationMode: TruncationMode.Fade
Layout.fillWidth: true
visible: text != ""
}
Label {
id: trackText
color: Theme.secondaryColor
font.pixelSize: Theme.fontSizeExtraSmall
horizontalAlignment: Text.AlignLeft
truncationMode: TruncationMode.Fade
Layout.fillWidth: true
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment