import QtQuick 2.4
import Ubuntu.Components 1.2
import UserMetrics 0.1
import com.canonical.Oxide 1.5 as Oxide
import "../Components"

Item {
    property var msgModel
    clip: true
    visible: msgModel.hasValidIndex
    anchors {
        top: envelopeHeader.bottom
        left: parent.left
        right: parent.right
        bottom: parent.bottom
    }

    DekkoWebView {
        id: wv
        anchors {
            fill: parent
        }
        property int currentZoomLevel: 100
        locationBarController.mode: Oxide.LocationBarController.ModeAuto
        locationBarController.height: h.height
    }
    ThreadMessageHeader {
        id: h
        width: parent.width
        y: wv ? wv.locationBarController.offset : 0
    }
    Rectangle {
        id: btmshadow
        anchors {
            left: parent.left
            right: parent.right
            top: parent.top
        }
        opacity: wv.locationBarController.offset > 10 ? 0.8 : 0.0
        Behavior on opacity {
            UbuntuNumberAnimation{}
        }

        height: units.gu(0.8)
        gradient: Gradient {
            GradientStop { position: 0.0; color: UbuntuColors.warmGrey }
            GradientStop { position: 1.0; color: "transparent" }
        }
    }
}
