summaryrefslogtreecommitdiff
path: root/SDL_Core/src/components/qt_hmi/References/Work/bananasnacks/qml/Bananas/Components/MediaBrowser.qml
blob: f0ef3ed2aecdc4de530176d11059be132441b8bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import QtQuick 2.0

ListView {
    id: listView
    anchors.fill: parent
    anchors.topMargin: 120
    spacing: 10
    clip: true
    model: MediaModel

    delegate: Button {
        width: 500
        anchors.horizontalCenter: parent.horizontalCenter
        OverflowableText {
            text: name
            fontColor: "#fff"
            font.pixelSize: 20
            anchors.verticalCenter: parent.verticalCenter
            anchors.left: parent.left
            anchors.leftMargin: 20
            width: parent.width - 40
        }
        Text {
            text: (model.count === 0) ? "" : model.count
            anchors.right: parent.right
            anchors.rightMargin: 20
            anchors.verticalCenter: parent.verticalCenter
            color: "#fff"
        }

        onPress: {
            if (model.is_file) {
                MediaPlayer.setPlaylist(model.pid, model.index);
                usb.state = '';
            } else {
                MediaModel.browseToChild(model.id)
            }
        }
    }
}