Commit 9b1e923c authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

makes background of player control transparent and extend album cover image

parent 7fdbd911
......@@ -33,6 +33,7 @@ Item {
property string tracksCount
property int trackRating
property bool ratingVisible
property alias playerControl: playControlItem
Image {
id: background
......@@ -68,9 +69,19 @@ Item {
}
}
MediaPlayerControl {
id: playControlItem
anchors.left: background.left
anchors.right: background.right
anchors.bottom: background.bottom
height: elisaTheme.mediaPlayerControlHeight
}
LabelWithToolTip {
id: backgroundCopyright
anchors.bottom: parent.bottom
anchors.bottom: playControlItem.top
anchors.right: parent.right
anchors.bottomMargin: elisaTheme.layoutVerticalMargin
anchors.rightMargin: elisaTheme.layoutVerticalMargin
......@@ -83,7 +94,13 @@ Item {
}
ColumnLayout {
anchors.fill: parent
id: contentZone
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: playControlItem.top
spacing: 0
Item {
......@@ -100,13 +117,13 @@ Item {
Item {
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
Layout.preferredHeight: headerBar.height * 0.9
Layout.minimumHeight: headerBar.height * 0.9
Layout.maximumHeight: headerBar.height * 0.9
Layout.preferredWidth: headerBar.height * 0.9
Layout.minimumWidth: headerBar.height * 0.9
Layout.maximumWidth: headerBar.height * 0.9
Layout.leftMargin: headerBar.width * 0.15
Layout.preferredHeight: contentZone.height * 0.9
Layout.minimumHeight: contentZone.height * 0.9
Layout.maximumHeight: contentZone.height * 0.9
Layout.preferredWidth: contentZone.height * 0.9
Layout.minimumWidth: contentZone.height * 0.9
Layout.maximumWidth: contentZone.height * 0.9
Layout.leftMargin: contentZone.width * 0.15
Image {
id: mainIcon
......@@ -116,8 +133,8 @@ Item {
source: (image ? image : Qt.resolvedUrl(elisaTheme.albumCover))
sourceSize {
width: headerBar.height * 0.9
height: headerBar.height * 0.9
width: contentZone.height * 0.9
height: contentZone.height * 0.9
}
fillMode: Image.PreserveAspectFit
......
......@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
import QtQuick 2.4
import QtQuick 2.7
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtQuick.Layouts 1.1
......@@ -99,8 +99,8 @@ ApplicationWindow {
persistentSettings.playListControlerState = playListControlerItem.persistentState;
persistentSettings.audioPlayerState = manageAudioPlayer.persistentState
persistentSettings.playControlItemVolume = playControlItem.volume
persistentSettings.playControlItemMuted = playControlItem.muted
persistentSettings.playControlItemVolume = headerBar.playerControl.volume
persistentSettings.playControlItemMuted = headerBar.playerControl.muted
}
}
......@@ -129,12 +129,12 @@ ApplicationWindow {
AudioWrapper {
id: audioPlayer
muted: playControlItem.muted
muted: headerBar.playerControl.muted
volume: playControlItem.volume * 100
volume: headerBar.playerControl.volume * 100
onVolumeChanged: playControlItem.volume = volume / 100.0
onMutedChanged: playControlItem.muted = muted
onVolumeChanged: headerBar.playerControl.volume = volume / 100.0
onMutedChanged: headerBar.playerControl.muted = muted
source: manageAudioPlayer.playerSource
......@@ -338,74 +338,69 @@ ApplicationWindow {
anchors.fill: parent
spacing: 0
HeaderBar {
id: headerBar
Layout.preferredHeight: mainWindow.height * 0.2
Layout.minimumHeight: mainWindow.height * 0.2
Layout.maximumHeight: mainWindow.height * 0.2
Item {
Layout.preferredHeight: mainWindow.height * 0.2 + elisaTheme.mediaPlayerControlHeight
Layout.minimumHeight: mainWindow.height * 0.2 + elisaTheme.mediaPlayerControlHeight
Layout.maximumHeight: mainWindow.height * 0.2 + elisaTheme.mediaPlayerControlHeight
Layout.fillWidth: true
tracksCount: myHeaderBarManager.remainingTracks
album: myHeaderBarManager.album
title: myHeaderBarManager.title
artist: myHeaderBarManager.artist
image: myHeaderBarManager.image
HeaderBar {
id: headerBar
ratingVisible: false
anchors.fill: parent
ToolButton {
id: menuButton
tracksCount: myHeaderBarManager.remainingTracks
album: myHeaderBarManager.album
title: myHeaderBarManager.title
artist: myHeaderBarManager.artist
image: myHeaderBarManager.image
action: applicationMenuAction
ratingVisible: false
z: 2
playerControl.duration: audioPlayer.duration
playerControl.seekable: audioPlayer.seekable
anchors
{
right: parent.right
top: parent.top
rightMargin: elisaTheme.layoutHorizontalMargin * 3
topMargin: elisaTheme.layoutHorizontalMargin * 3
}
}
Rectangle {
anchors.fill: menuButton
playerControl.volume: persistentSettings.playControlItemVolume
playerControl.muted: persistentSettings.playControlItemMuted
playerControl.position: audioPlayer.position
playerControl.skipBackwardEnabled: myPlayControlManager.skipBackwardControlEnabled
playerControl.skipForwardEnabled: myPlayControlManager.skipForwardControlEnabled
playerControl.playEnabled: myPlayControlManager.playControlEnabled
playerControl.isPlaying: myPlayControlManager.musicPlaying
z: 1
playerControl.onSeek: audioPlayer.seek(position)
radius: width / 2
playerControl.onPlay: manageAudioPlayer.playPause()
playerControl.onPause: manageAudioPlayer.playPause()
color: myPalette.window
}
}
playerControl.onPlayPrevious: playListControlerItem.skipPreviousTrack()
playerControl.onPlayNext: playListControlerItem.skipNextTrack()
MediaPlayerControl {
id: playControlItem
ToolButton {
id: menuButton
duration: audioPlayer.duration
seekable: audioPlayer.seekable
action: applicationMenuAction
volume: persistentSettings.playControlItemVolume
muted: persistentSettings.playControlItemMuted
position: audioPlayer.position
skipBackwardEnabled: myPlayControlManager.skipBackwardControlEnabled
skipForwardEnabled: myPlayControlManager.skipForwardControlEnabled
playEnabled: myPlayControlManager.playControlEnabled
isPlaying: myPlayControlManager.musicPlaying
z: 2
Layout.preferredHeight: elisaTheme.mediaPlayerControlHeight
Layout.minimumHeight: elisaTheme.mediaPlayerControlHeight
Layout.maximumHeight: elisaTheme.mediaPlayerControlHeight
Layout.fillWidth: true
anchors
{
right: parent.right
top: parent.top
rightMargin: elisaTheme.layoutHorizontalMargin * 3
topMargin: elisaTheme.layoutHorizontalMargin * 3
}
}
Rectangle {
anchors.fill: menuButton
onSeek: audioPlayer.seek(position)
z: 1
onPlay: manageAudioPlayer.playPause()
onPause: manageAudioPlayer.playPause()
radius: width / 2
onPlayPrevious: playListControlerItem.skipPreviousTrack()
onPlayNext: playListControlerItem.skipNextTrack()
color: myPalette.window
}
}
}
RowLayout {
......
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