diff --git a/src/kcm/package/contents/ui/Advanced.qml b/src/kcm/package/contents/ui/Advanced.qml index 90be792..9742ff2 100644 --- a/src/kcm/package/contents/ui/Advanced.qml +++ b/src/kcm/package/contents/ui/Advanced.qml @@ -1,78 +1,83 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.3 import org.kde.plasma.private.volume 0.1 ScrollView { id: scrollView ColumnLayout { - width: scrollView.viewport.width + Component.onCompleted: { + // Normal binding causes binding loops + width = Qt.binding(function() { + return scrollView.viewport.width; + }); + } Header { Layout.fillWidth: true enabled: 0 < view.count text: i18n("Device Profiles") disabledText: i18nc("@label", "No Device Profiles Available") } ListView { id: view Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false spacing: units.smallSpacing * 2 model: CardModel {} delegate: CardListItem {} } Header { Layout.fillWidth: true text: i18n("Advanced Output Configuration") } ModuleManager { id: moduleManager } CheckBox { Layout.fillWidth: true Layout.topMargin: units.smallSpacing Layout.leftMargin: units.gridUnit / 2 Layout.rightMargin: units.gridUnit / 2 width: parent.width text: i18n("Add virtual output device for simultaneous output on all local sound cards") checked: moduleManager.combineSinks onCheckedChanged: moduleManager.combineSinks = checked; } CheckBox { Layout.fillWidth: true Layout.leftMargin: units.gridUnit / 2 Layout.rightMargin: units.gridUnit / 2 text: i18n("Automatically switch all running streams when a new output becomes available") checked: moduleManager.switchOnConnect onCheckedChanged: moduleManager.switchOnConnect = checked; } } } diff --git a/src/kcm/package/contents/ui/Applications.qml b/src/kcm/package/contents/ui/Applications.qml index f1fc660..dda9c95 100644 --- a/src/kcm/package/contents/ui/Applications.qml +++ b/src/kcm/package/contents/ui/Applications.qml @@ -1,99 +1,104 @@ /* Copyright 2014-2015 Harald Sitter Copyright 2016 David Rosca This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.3 import org.kde.plasma.private.volume 0.1 ScrollView { id: scrollView anchors.fill: parent ColumnLayout { - width: scrollView.viewport.width + Component.onCompleted: { + // Normal binding causes binding loops + width = Qt.binding(function() { + return scrollView.viewport.width; + }); + } property bool appsPlayingAudio: eventStreamView.visible || sinkInputView.visible Header { enabled: parent.appsPlayingAudio text: i18n("Playback") disabledText: i18nc("@label", "No Applications Playing Audio") } ListView { id: eventStreamView Layout.fillWidth: true Layout.minimumHeight: contentHeight Layout.maximumHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false visible: count > 0 spacing: units.largeSpacing model: PulseObjectFilterModel { filters: [ { role: "Name", value: "sink-input-by-media-role:event" } ] sourceModel: StreamRestoreModel {} } delegate: StreamListItem { deviceModel: sinkModel } } ListView { id: sinkInputView Layout.fillWidth: true Layout.minimumHeight: contentHeight Layout.maximumHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false visible: count > 0 spacing: units.largeSpacing model: PulseObjectFilterModel { filters: [ { role: "VirtualStream", value: false } ] sourceModel: SinkInputModel {} } delegate: StreamListItem { deviceModel: sinkModel } } Header { Layout.fillWidth: true enabled: capturestreams.count > 0 text: i18n("Capture") disabledText: i18nc("@label", "No Applications Recording Audio") } ListView { id: capturestreams model: PulseObjectFilterModel { filters: [ { role: "VirtualStream", value: false } ] sourceModel: SourceOutputModel {} } delegate: StreamListItem { deviceModel: sourceModel } } } } diff --git a/src/kcm/package/contents/ui/Devices.qml b/src/kcm/package/contents/ui/Devices.qml index 862f9be..9da368a 100644 --- a/src/kcm/package/contents/ui/Devices.qml +++ b/src/kcm/package/contents/ui/Devices.qml @@ -1,66 +1,71 @@ /* Copyright 2014-2015 Harald Sitter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.3 ScrollView { id: scrollView ColumnLayout { - width: scrollView.viewport.width + Component.onCompleted: { + // Normal binding causes binding loops + width = Qt.binding(function() { + return scrollView.viewport.width; + }); + } Header { Layout.fillWidth: true enabled: 0 < sinks.count text: i18n("Outputs") disabledText: i18nc("@label", "No Output Devices Available") } ListView { id: sinks Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false spacing: units.smallSpacing * 2 model: sinkModel delegate: DeviceListItem {} } Header { Layout.fillWidth: true enabled: sources.count > 0 text: i18n("Inputs") disabledText: i18nc("@label", "No Input Devices Available") } ListView { id: sources Layout.fillWidth: true Layout.preferredHeight: contentHeight Layout.margins: units.gridUnit / 2 interactive: false model: sourceModel delegate: DeviceListItem {} } } }