737 B · text History cc97953
import QtQuick
import org.kde.plasma.components as PlasmaComponents3

// A scrolling list with an empty-state line, the shape every tab shares.
PlasmaComponents3.ScrollView {
    id: pane

    property alias model: list.model
    property alias delegate: list.delegate
    property string empty: ""

    contentWidth: availableWidth

    ListView {
        id: list
        clip: true
        reuseItems: false
        spacing: 0

        PlasmaComponents3.Label {
            anchors.centerIn: parent
            width: parent.width * 0.8
            horizontalAlignment: Text.AlignHCenter
            wrapMode: Text.WordWrap
            visible: list.count === 0
            opacity: 0.7
            text: pane.empty
        }
    }
}