<commit_before>import QtQuick 1.1

ListView {
    id: root
    focus: true

    SystemPalette { 
        id: palette
        colorGroup: SystemPalette.Active 
    }

    anchors.fill: parent
    model: skinManager.skinsModel

    delegate: Rectangle {
        id: delegate
        width: ListView.view.width
        height: text.implicitHeight
        color: ListView.isCurrentItem ? palette.highlight : "transparent"

        Text {
            id: text
            anchors.fill: parent
            text: model.modelData.name
            color: delegate.ListView.view.isCurrentItem ? palette.highlightedText : palette.text
        }

        MouseArea {
            id: mouseArea
            anchors.fill: parent
            onClicked: delegate.ListView.view.currentIndex = index
            onDoubleClicked: window.setSkin(model.modelData.name)
        }

        Keys.onEnterPressed: window.setSkin(model.modelData.name)
        Keys.onReturnPressed: window.setSkin(model.modelData.name)
    }
}

<commit_msg>Use skin.manifest to display skin meta information<commit_after>import QtQuick 1.1

ListView {
    id: root
    focus: true

    SystemPalette { 
        id: palette
        colorGroup: SystemPalette.Active 
    }

    anchors.fill: parent
    model: skinManager.skinsModel

    delegate: Rectangle {
        id: delegate
        width: ListView.view.width
        height: Math.max(column.height, screenshot.height)
        color: ListView.isCurrentItem ? palette.highlight : "transparent"

        Image {
            id: screenshot
            width: 75
            height: 50
            fillMode: Image.PreserveAspectFit
            smooth: true
        }

        Column {
            id: column
            anchors {
                topMargin: 5
                bottomMargin: 5
                leftMargin: 10
                left: screenshot.right
            }
            spacing: 3
            Text {
                id: skinName
                font.bold: true
                text: model.modelData.name
                color: delegate.ListView.view.isCurrentItem ? palette.highlightedText : palette.text
            }

            Text {
                id: skinAuthors
                font.pointSize: skinName.font.pointSize - 4
            }

            Text {
                id: website
                font.pointSize: skinName.font.pointSize - 4
            }
        }

        MouseArea {
            id: mouseArea
            anchors.fill: parent

            onClicked: delegate.ListView.view.currentIndex = index
            onDoubleClicked: window.setSkin(model.modelData.name)
        }

        Keys.onEnterPressed: window.setSkin(model.modelData.name)
        Keys.onReturnPressed: window.setSkin(model.modelData.name)

        Component.onCompleted: {
            var doc = new XMLHttpRequest()
            doc.onreadystatechange = function() {
                if (doc.readyState == XMLHttpRequest.DONE && doc.responseText) {
                    var manifest = eval('(' + doc.responseText + ')')
                    if (manifest.screenshot)
                        screenshot.source = "file://" + model.modelData.path + "/" + manifest.screenshot
                    var authors = []
                    for (var i = 0; i < manifest.authors.length; i++) {
                        authors.push(manifest.authors[i].name)
                    }
                    skinAuthors.text = "By " + authors.join(", ")
                    website.text = manifest.website
                }
            }
            doc.open("GET", "file://" + model.modelData.path + "/skin.manifest")
            doc.send()
        }
    }
}


{'fraction_non_alphanumeric': 0.08543263964950712, 'fraction_numerical': 0.004381161007667032, 'mean_word_length': 1.4599326599326599, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4195606', 'n_tokens_mistral': 1032, 'n_tokens_neox': 940, 'n_words': 193}