import QtQuick 1.0
import 'database.js' as Db

Item {
    Rectangle {
        anchors.fill: parent
        color: "black"
        opacity: 0.4
    }

    Image {
        id: topic

        anchors {
            horizontalCenter: parent.horizontalCenter
            top: parent.top
        }
        source: "gfx/highScores.png"
    }

    ListView {
        id: rankingList

        anchors {
            top: topic.bottom
            topMargin: topic.anchors.topMargin
            horizontalCenter: parent.horizontalCenter
        }

        width: 200
        height: 30*model.count
        model: Db.getRankingsModel();
        delegate: Item {
            height: text.height
            Text {
                id: text

                color: textColor
                font.pixelSize: 20
                text: placement + ".";
            }
            Text {
                color: textColor
                font.pixelSize: 20
                x: 40
                text: name
            }
            Text {
                color: textColor
                font.pixelSize: 20
                x: rankingList.width-60
                text: rankTime;
            }
        }
    }
}
