diff --git a/applet/contents/ui/ListItemBase.qml b/applet/contents/ui/ListItemBase.qml --- a/applet/contents/ui/ListItemBase.qml +++ b/applet/contents/ui/ListItemBase.qml @@ -116,9 +116,15 @@ wrapMode: Text.NoWrap elide: Text.ElideRight } - SmallToolButton { + PlasmaComponents.Button { + text: i18n("Make Default") + onClicked: PulseObject.default = true; + enabled: !PulseObject.default + visible: (type == "sink" && sinkView.model.count > 1) || (type == "source" && sourceView.model.count > 1) + } + PlasmaComponents.Button { id: contextMenuButton - icon: "application-menu" + iconName: "application-menu" checkable: true onClicked: contextMenu.show() tooltip: i18n("Show additional options for %1", textLabel.text) @@ -265,28 +271,6 @@ function loadDynamicActions() { contextMenu.clearMenuItems(); - // Mute - var menuItem = newMenuItem(); - menuItem.text = i18nc("Checkable switch for (un-)muting sound output.", "Mute"); - menuItem.checkable = true; - menuItem.checked = Muted; - menuItem.clicked.connect(function() { - Muted = !Muted - }); - contextMenu.addMenuItem(menuItem); - - // Default - if (typeof PulseObject.default === "boolean") { - var menuItem = newMenuItem(); - menuItem.text = i18nc("Checkable switch to change the current default output.", "Default"); - menuItem.checkable = true; - menuItem.checked = PulseObject.default - menuItem.clicked.connect(function() { - PulseObject.default = true - }); - contextMenu.addMenuItem(menuItem); - } - // Raise max volume menuItem = newMenuItem(); menuItem.text = i18n("Raise maximum volume"); diff --git a/src/kcm/package/contents/ui/DefaultDeviceButton.qml b/src/kcm/package/contents/ui/DefaultDeviceButton.qml deleted file mode 100644 --- a/src/kcm/package/contents/ui/DefaultDeviceButton.qml +++ /dev/null @@ -1,30 +0,0 @@ -/* - 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.Controls 1.0 - -RadioButton { - property bool isDefault: true - - checked: isDefault - text: checked ? i18nd("kcm_pulseaudio", "Default") : "" - onIsDefaultChanged: checked = isDefault -} 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 @@ -44,17 +44,11 @@ text: Description } - DefaultDeviceButton { + Button { + text: i18n("Make Default") visible: delegate.ListView.view.count > 1 - isDefault: Default - onCheckedChanged: { - if (!checked) { - // Cannot unset default device - checked = isDefault; - } else { - Default = true; - } - } + enabled: !Default + onClicked: Default = true; } MuteButton {