<commit_before>import Qt 4.6

Item {
    id: root

    property alias background: background.source
    default property alias content: visualModel.children
    property int currentIndex: 0

    Image {
        id: background
        fillMode: Image.TileHorizontally
        x: -list.contentX / 2
        width: Math.max(list.contentWidth, parent.width)
    }

    ListView {
        id: list

        currentIndex: root.currentIndex
        onCurrentIndexChanged: root.currentIndex = currentIndex 

        orientation: "Horizontal"
        overShoot: false
        anchors.fill: parent
        model: VisualItemModel { id: visualModel }

        snapMode: ListView.SnapOneItem
    }

    ListView {
        id: selector

        Rectangle {
            color: "#60FFFFFF"
            x: -10; y: -10; radius: 10; z: -1
            width: parent.width + 20; height: parent.height + 20
        }
        currentIndex: root.currentIndex
        onCurrentIndexChanged: root.currentIndex = currentIndex

        height: 50
        anchors.bottom: parent.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        width: Math.min(count * 50, parent.width - 20)
        interactive: width == parent.width - 20
        orientation: "Horizontal"
<commit_msg>Make sure currentIndex is updated when view is flicked.<commit_after>import Qt 4.6

Item {
    id: root

    property alias background: background.source
    default property alias content: visualModel.children
    property int currentIndex: 0

    Image {
        id: background
        fillMode: Image.TileHorizontally
        x: -list.contentX / 2
        width: Math.max(list.contentWidth, parent.width)
    }

    ListView {
        id: list

        currentIndex: root.currentIndex
        onCurrentIndexChanged: root.currentIndex = currentIndex 

        orientation: "Horizontal"
        overShoot: false
        anchors.fill: parent
        model: VisualItemModel { id: visualModel }

        highlightRangeMode: ListView.StrictlyEnforceRange
        snapMode: ListView.SnapOneItem
    }

    ListView {
        id: selector

        Rectangle {
            color: "#60FFFFFF"
            x: -10; y: -10; radius: 10; z: -1
            width: parent.width + 20; height: parent.height + 20
        }
        currentIndex: root.currentIndex
        onCurrentIndexChanged: root.currentIndex = currentIndex

        height: 50
        anchors.bottom: parent.bottom
        anchors.horizontalCenter: parent.horizontalCenter
        width: Math.min(count * 50, parent.width - 20)
        interactive: width == parent.width - 20
        orientation: "Horizontal"

{'fraction_non_alphanumeric': 0.07724505327245053, 'fraction_numerical': 0.01902587519025875, 'mean_word_length': 2.140979689366786, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4037045', 'n_tokens_mistral': 756, 'n_tokens_neox': 693, 'n_words': 194}