diff --git a/src/kcm/package/contents/ui/CardListItem.qml b/src/kcm/package/contents/ui/CardListItem.qml --- a/src/kcm/package/contents/ui/CardListItem.qml +++ b/src/kcm/package/contents/ui/CardListItem.qml @@ -28,6 +28,8 @@ id: delegate width: parent.width + ListItemSeperator { view: delegate.ListView.view } + RowLayout { QIconItem { id: clientIcon @@ -63,6 +65,4 @@ onActivated: ActiveProfileIndex = index } } - - ListItemSeperator { view: delegate.ListView.view } } diff --git a/src/kcm/package/contents/ui/DeviceListItem.qml b/src/kcm/package/contents/ui/DeviceListItem.qml --- a/src/kcm/package/contents/ui/DeviceListItem.qml +++ b/src/kcm/package/contents/ui/DeviceListItem.qml @@ -28,6 +28,8 @@ id: delegate width: parent.width + ListItemSeperator { view: delegate.ListView.view } + RowLayout { QIconItem { width: height @@ -84,6 +86,4 @@ VolumeSlider {} } - - ListItemSeperator { view: delegate.ListView.view } } diff --git a/src/kcm/package/contents/ui/ListItemSeperator.qml b/src/kcm/package/contents/ui/ListItemSeperator.qml --- a/src/kcm/package/contents/ui/ListItemSeperator.qml +++ b/src/kcm/package/contents/ui/ListItemSeperator.qml @@ -26,7 +26,7 @@ Layout.fillWidth: true - visible: (view.count != 0) && (view.count != (index + 1)) + visible: (view.count != 0) && index != 0 color: systemPalette.mid height: Math.ceil(units.gridUnit / 20) diff --git a/src/kcm/package/contents/ui/SinkInputView.qml b/src/kcm/package/contents/ui/SinkInputView.qml --- a/src/kcm/package/contents/ui/SinkInputView.qml +++ b/src/kcm/package/contents/ui/SinkInputView.qml @@ -37,35 +37,35 @@ width: scrollView.viewport.width ListView { - id: eventStreamView + id: sinkInputView Layout.fillWidth: true Layout.minimumHeight: contentHeight Layout.maximumHeight: contentHeight Layout.margins: units.gridUnit / 2 - model: PulseObjectFilterModel { - filters: [ { role: "Name", value: "sink-input-by-media-role:event" } ] - sourceModel: StreamRestoreModel {} - } - delegate: StreamListItem { - deviceModel: sinkModel - } boundsBehavior: Flickable.StopAtBounds; visible: count > 0 spacing: units.largeSpacing + delegate: StreamListItem { + deviceModel: sinkModel + } } ListView { - id: sinkInputView + id: eventStreamView Layout.fillWidth: true Layout.minimumHeight: contentHeight Layout.maximumHeight: contentHeight Layout.margins: units.gridUnit / 2 - boundsBehavior: Flickable.StopAtBounds; - visible: count > 0 - spacing: units.largeSpacing + model: PulseObjectFilterModel { + filters: [ { role: "Name", value: "sink-input-by-media-role:event" } ] + sourceModel: StreamRestoreModel {} + } delegate: StreamListItem { deviceModel: sinkModel } + boundsBehavior: Flickable.StopAtBounds; + visible: count > 0 + spacing: units.largeSpacing } } } diff --git a/src/kcm/package/contents/ui/StreamListItem.qml b/src/kcm/package/contents/ui/StreamListItem.qml --- a/src/kcm/package/contents/ui/StreamListItem.qml +++ b/src/kcm/package/contents/ui/StreamListItem.qml @@ -34,6 +34,18 @@ width: parent.width + ListItemSeperator { + view: delegate.ListView.view + + Component.onCompleted: { + if (isEventStream) { + visible = Qt.binding(function() { + return sinkInputView.count > 0; + }); + } + } + } + RowLayout { Layout.fillWidth: true spacing: units.smallSpacing * 2 @@ -83,16 +95,4 @@ VolumeSlider {} } } - - ListItemSeperator { - view: delegate.ListView.view - - Component.onCompleted: { - if (isEventStream) { - visible = Qt.binding(function() { - return sinkInputView.count > 0; - }); - } - } - } }