Commit aa3c7235 authored by Nate Graham's avatar Nate Graham 💤
Browse files

[applet] Allow showing inactive devices as in the KCM

This commit got dropped from
!5 when it
landed, somehow.
parent 081b11b7
......@@ -256,10 +256,26 @@ Item {
}
}
PulseObjectFilterModel {
id: paSinkFilterModel
sortRole: "SortByDefault"
sortOrder: Qt.DescendingOrder
filterOutInactiveDevices: true
sourceModel: paSinkModel
}
SourceModel {
id: paSourceModel
}
PulseObjectFilterModel {
id: paSourceFilterModel
sortRole: "SortByDefault"
sortOrder: Qt.DescendingOrder
filterOutInactiveDevices: true
sourceModel: paSourceModel
}
Plasmoid.compactRepresentation: PlasmaCore.IconItem {
source: plasmoid.icon
active: mouseArea.containsMouse
......@@ -527,12 +543,8 @@ Item {
Layout.maximumHeight: contentHeight
spacing: 0
model: PulseObjectFilterModel {
sortRole: "SortByDefault"
sortOrder: Qt.DescendingOrder
filterOutInactiveDevices: true
sourceModel: paSinkModel
}
model: showHiddenDevices.checked || !showHiddenDevices.visible ? paSinkModel : paSinkFilterModel
boundsBehavior: Flickable.StopAtBounds;
delegate: DeviceListItem {
type: "sink"
......@@ -558,12 +570,8 @@ Item {
Layout.minimumHeight: contentHeight
Layout.maximumHeight: contentHeight
model: PulseObjectFilterModel {
sortRole: "SortByDefault"
sortOrder: Qt.DescendingOrder
filterOutInactiveDevices: true
sourceModel: paSourceModel
}
model: showHiddenDevices.checked || !showHiddenDevices.visible ? paSourceModel : paSourceFilterModel
boundsBehavior: Flickable.StopAtBounds;
delegate: DeviceListItem {
type: "source"
......@@ -633,6 +641,21 @@ Item {
Layout.fillWidth: true
}
PlasmaComponents3.ToolButton {
id: showHiddenDevices
icon.name: "view-visible"
// Only show if there actually are any inactive devices
visible: (paSourceModel.rowCount != paSourceFilterModel.rowCount) || (paSinkModel.rowCount != paSinkFilterModel.rowCount)
checkable: true
Accessible.name: i18n("show hidden devices")
PlasmaComponents3.ToolTip {
text: i18n("Show hidden devices")
}
}
PlasmaComponents3.ToolButton {
id: globalMuteCheckbox
icon.name: "audio-volume-muted"
......
......@@ -74,7 +74,7 @@ ScrollView {
Layout.margins: Kirigami.Units.gridUnit / 2
interactive: false
spacing: Kirigami.Units.gridUnit
model: inactiveDevicesButton.checked ? paSinkModel : paSinkFilterModel
model: inactiveDevicesButton.checked || !inactiveDevicesButton.visible ? paSinkModel : paSinkFilterModel
delegate: DeviceListItem {
isPlayback: true
}
......@@ -94,7 +94,7 @@ ScrollView {
Layout.margins: Kirigami.Units.gridUnit / 2
interactive: false
spacing: Kirigami.Units.gridUnit
model: inactiveDevicesButton.checked ? paSourceModel : paSourceFilterModel
model: inactiveDevicesButton.checked || !inactiveDevicesButton.visible ? paSourceModel : paSourceFilterModel
delegate: DeviceListItem {
isPlayback: false
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment