Changeset View
Changeset View
Standalone View
Standalone View
src/kcm/package/contents/ui/main.qml
Show All 20 Lines | |||||
21 | import QtQuick 2.7 | 21 | import QtQuick 2.7 | ||
22 | import QtQuick.Layouts 1.3 | 22 | import QtQuick.Layouts 1.3 | ||
23 | import QtQuick.Controls 2.0 | 23 | import QtQuick.Controls 2.0 | ||
24 | 24 | | |||
25 | import org.kde.kcm 1.0 | 25 | import org.kde.kcm 1.0 | ||
26 | import org.kde.plasma.core 2.0 as PlasmaCore /* for units.gridUnit */ | 26 | import org.kde.plasma.core 2.0 as PlasmaCore /* for units.gridUnit */ | ||
27 | import org.kde.kirigami 2.5 as Kirigami | 27 | import org.kde.kirigami 2.5 as Kirigami | ||
28 | import org.kde.plasma.private.volume 0.1 | 28 | import org.kde.plasma.private.volume 0.1 | ||
29 | import org.kde.kcm 1.3 as KCM | ||||
29 | 30 | | |||
30 | Kirigami.Page { | 31 | KCM.TabKCM { | ||
32 | id: root | ||||
31 | title: kcm.name | 33 | title: kcm.name | ||
32 | property QtObject sinkModel: SinkModel { } | 34 | property QtObject sinkModel: SinkModel { } | ||
33 | property QtObject sourceModel: SourceModel { } | 35 | property QtObject sourceModel: SourceModel { } | ||
34 | ConfigModule.quickHelp: i18nd("kcm_pulseaudio", "This module allows configuring the Pulseaudio sound subsystem.") | 36 | ConfigModule.quickHelp: i18nd("kcm_pulseaudio", "This module allows configuring the Pulseaudio sound subsystem.") | ||
35 | 37 | | |||
36 | // TODO: replace this TabBar-plus-Frame-in-a-ColumnLayout with whatever shakes | 38 | tabs: [deviceTab, appsTab, advancedTab] | ||
37 | // out of https://bugs.kde.org/show_bug.cgi?id=394296 | | |||
38 | ColumnLayout { | | |||
39 | anchors.fill: parent | | |||
40 | spacing: 0 | | |||
41 | | ||||
42 | TabBar { | | |||
43 | id: tabView | | |||
44 | | ||||
45 | // Tab styles generally assume that they're touching the inner layout, | | |||
46 | // not the frame, so we need to move the tab bar down a pixel and make | | |||
47 | // sure it's drawn on top of the frame | | |||
48 | Layout.bottomMargin: -1 | | |||
49 | z: 1 | | |||
50 | | ||||
51 | TabButton { | | |||
52 | text: i18ndc("kcm_pulseaudio", "@title:tab", "Devices") | | |||
53 | } | | |||
54 | TabButton { | | |||
55 | text: i18ndc("kcm_pulseaudio", "@title:tab", "Applications") | | |||
56 | } | | |||
57 | TabButton { | | |||
58 | text: i18ndc("kcm_pulseaudio", "@title:tab", "Advanced") | | |||
59 | } | | |||
60 | } | | |||
61 | Frame { | | |||
62 | Layout.fillWidth: true | | |||
63 | Layout.fillHeight: true | | |||
64 | | ||||
65 | StackLayout { | | |||
66 | anchors.fill: parent | | |||
67 | | ||||
68 | currentIndex: tabView.currentIndex | | |||
69 | 39 | | |||
40 | KCM.Tab { | ||||
41 | id: deviceTab | ||||
42 | title: i18ndc("kcm_pulseaudio", "@title:tab", "Devices") | ||||
43 | delegate: Component { | ||||
70 | Devices { | 44 | Devices { | ||
71 | Layout.fillWidth: true | 45 | Layout.fillWidth: true | ||
72 | Layout.fillHeight: true | 46 | Layout.fillHeight: true | ||
73 | } | 47 | } | ||
48 | } | ||||
49 | } | ||||
50 | | ||||
51 | KCM.Tab { | ||||
52 | id: appsTab | ||||
53 | title: i18ndc("kcm_pulseaudio", "@title:tab", "Applications") | ||||
54 | delegate: Component { | ||||
74 | Applications { | 55 | Applications { | ||
75 | Layout.fillWidth: true | 56 | Layout.fillWidth: true | ||
76 | Layout.fillHeight: true | 57 | Layout.fillHeight: true | ||
77 | } | 58 | } | ||
59 | } | ||||
60 | } | ||||
61 | | ||||
62 | KCM.Tab { | ||||
63 | id: advancedTab | ||||
64 | title: i18ndc("kcm_pulseaudio", "@title:tab", "Advanced") | ||||
65 | delegate: Component { | ||||
78 | Advanced { | 66 | Advanced { | ||
79 | Layout.fillWidth: true | 67 | Layout.fillWidth: true | ||
80 | Layout.fillHeight: true | 68 | Layout.fillHeight: true | ||
81 | } | 69 | } | ||
82 | } | 70 | } | ||
83 | } | 71 | } | ||
84 | } | 72 | } | ||
85 | } | |