diff --git a/src/kcm/package/contents/ui/main.qml b/src/kcm/package/contents/ui/main.qml --- a/src/kcm/package/contents/ui/main.qml +++ b/src/kcm/package/contents/ui/main.qml @@ -26,59 +26,46 @@ import org.kde.plasma.core 2.0 as PlasmaCore /* for units.gridUnit */ import org.kde.kirigami 2.5 as Kirigami import org.kde.plasma.private.volume 0.1 +import org.kde.kcm 1.3 as KCM -Kirigami.Page { +KCM.TabKCM { + id: root title: kcm.name property QtObject sinkModel: SinkModel { } property QtObject sourceModel: SourceModel { } ConfigModule.quickHelp: i18nd("kcm_pulseaudio", "This module allows configuring the Pulseaudio sound subsystem.") - // TODO: replace this TabBar-plus-Frame-in-a-ColumnLayout with whatever shakes - // out of https://bugs.kde.org/show_bug.cgi?id=394296 - ColumnLayout { - anchors.fill: parent - spacing: 0 + tabs: [deviceTab, appsTab, advancedTab] - TabBar { - id: tabView - - // Tab styles generally assume that they're touching the inner layout, - // not the frame, so we need to move the tab bar down a pixel and make - // sure it's drawn on top of the frame - Layout.bottomMargin: -1 - z: 1 - - TabButton { - text: i18ndc("kcm_pulseaudio", "@title:tab", "Devices") - } - TabButton { - text: i18ndc("kcm_pulseaudio", "@title:tab", "Applications") - } - TabButton { - text: i18ndc("kcm_pulseaudio", "@title:tab", "Advanced") + KCM.Tab { + id: deviceTab + title: i18ndc("kcm_pulseaudio", "@title:tab", "Devices") + delegate: Component { + Devices { + Layout.fillWidth: true + Layout.fillHeight: true } } - Frame { - Layout.fillWidth: true - Layout.fillHeight: true - - StackLayout { - anchors.fill: parent + } - currentIndex: tabView.currentIndex + KCM.Tab { + id: appsTab + title: i18ndc("kcm_pulseaudio", "@title:tab", "Applications") + delegate: Component { + Applications { + Layout.fillWidth: true + Layout.fillHeight: true + } + } + } - Devices { - Layout.fillWidth: true - Layout.fillHeight: true - } - Applications { - Layout.fillWidth: true - Layout.fillHeight: true - } - Advanced { - Layout.fillWidth: true - Layout.fillHeight: true - } + KCM.Tab { + id: advancedTab + title: i18ndc("kcm_pulseaudio", "@title:tab", "Advanced") + delegate: Component { + Advanced { + Layout.fillWidth: true + Layout.fillHeight: true } } }