import QtQuick 2.0
import Sailfish.Silica 1.0
import "../delegates"

CoverBackground {

    RadioImage {
        id:stationimage
        anchors.top: parent.top
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.margins: Theme.paddingLarge
        width: parent.width - Theme.paddingMedium * 2
        height: width
        stationImage: radioPlayer._favicon
        stationLabel: radioPlayer._name
        flag: false
    }
    Item {
        id: artistSongName

        anchors.top: stationimage.bottom
        anchors.bottom: coverActionArea.top
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.margins: Theme.paddingLarge
        width: parent.width - (Theme.paddingMedium * 2) //parent.width - (Theme.paddingMedium * 2)
        height: radioname.height + radiocountry.height + (Theme.paddingMedium * 3)

        Column {
            width: parent.width//radioname.width > radiocountry.width ? radioname.width : radiocountry.width
            anchors.verticalCenter: parent.verticalCenter
            Label {
                id: radioname
                font.bold: true
                color: Theme.primaryColor
                wrapMode: Text.WordWrap
                font.pixelSize: Theme.fontSizeTiny
                fontSizeMode: Text.Fit
                maximumLineCount: 2
                width: parent.width
                elide: Text.ElideLeft
                horizontalAlignment: Text.AlignHCenter
                text: radioPlayer.radioArtist ? radioPlayer.radioArtist : "AllRadio2"
            }
            Label {
                id: radiocountry
                color: Theme.primaryColor
                wrapMode: Text.WordWrap
                font.pixelSize: Theme.fontSizeTiny
                fontSizeMode: Text.Fit
                maximumLineCount: 2
                width: parent.width
                elide: Text.ElideLeft
                horizontalAlignment: Text.AlignHCenter
                visible: radioPlayer.radioSong ? true : false
                text: radioPlayer.radioSong
            }
        }
    }
    CoverActionList {
        CoverAction {
            iconSource: radioPlayer.isPlaying ? "image://theme/icon-cover-pause" : "image://theme/icon-cover-play"
            onTriggered: radioPlayer.isPlaying ? radioPlayer.pauseStream() : radioPlayer.resumeStream()// radioPlayer.radioPlaying ? radioPlayer.pauseStream() : radioPlayer.resumeStream()//icon.source == "image://theme/icon-l-play" ? icon.source = "image://theme/icon-l-pause" : icon.source = "image://theme/icon-l-play"
        }
    }
}
