import QtQuick 2.12
import BTPhone 1.0
import QtQuick.Controls 2.15

Item {
    id: root
    width: 800
    height: 320
    property alias rootState: root.state

    ListView {
        id: contentList
        anchors.top: parent.top
        anchors.left: parent.left
        anchors.bottom: bottomTab.top
        anchors.right: parent.right
        spacing: 5
        delegate: ContentListDelegate {
            id: contentListDelegate
            width: contentList.width
        }
        model: bT_RCNTContentListModel

        header: Rectangle {
            id: header
            width: parent.width
            height: 55
            color: "#ffffff"

            Image {
                id: totalIcon
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: parent.left
                anchors.leftMargin: 15
                height: 40
                width: height
                source: "image_sample.JPG"
            }

            Text {
                id: totalText
                text: qsTrId("LID_585")
                anchors.verticalCenter: parent.verticalCenter
                anchors.left: totalIcon.right
                anchors.leftMargin: 10
                font.pixelSize: 25
            }
        }

        ScrollBar.vertical: ScrollBar {
            policy: ScrollBar.AlwaysOn
        }
    }

    TabBar {
        id: bottomTab
        position: TabBar.Footer
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.bottom: parent.bottom

        TabButton {
            id: allTab
            text: qsTrId("LID_958")
        }

        TabButton {
            id: dialedTab
            text: qsTr("LID_586")
        }

        TabButton {
            id: receivedTab
            text: qsTr("LID_587")
        }

        TabButton {
            id: missedTab
            text: qsTr("LID_588")
        }
    }

    BT_RCNTContentListModel {
        id: bT_RCNTContentListModel
    }
    states: [
        State {
            name: "All"
        },
        State {
            name: "Dialed"

            PropertyChanges {
                target: bottomTab
                currentIndex: 1
            }
        },
        State {
            name: "Received"
            PropertyChanges {
                target: bottomTab
                currentIndex: 2
            }
        },
        State {
            name: "Missed"
            PropertyChanges {
                target: bottomTab
                currentIndex: 3
            }
        }
    ]
}

/*##^##
Designer {
    D{i:0;height:320;width:800}
}
##^##*/

