Commit 7811411c authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[KCM] Add output selector ComboBox

Since hidden outputs aren't shown in the output view for some reason, provide a ComboBox to switch between outputs
since the bullet points with swipe view aren't very obvious.

BUG: 413014

Differential Revision: https://phabricator.kde.org/D24687
parent ae555055
......@@ -25,14 +25,6 @@ ColumnLayout {
id: outputPanel
property var element: model
Kirigami.Heading {
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
level: 2
text: i18n("Settings for %1", element.display)
visible: kcm.outputModel.rowCount() > 1
}
Kirigami.FormLayout {
twinFormLayouts: globalSettingsLayout
......
......@@ -22,6 +22,31 @@ import org.kde.kirigami 2.4 as Kirigami
import org.kde.private.kcm.kscreen 1.0 as KScreen
ColumnLayout {
RowLayout {
Layout.alignment: Qt.AlignHCenter
spacing: 0
visible: kcm.outputModel.rowCount() > 1
Kirigami.Heading {
horizontalAlignment: Text.AlignHCenter
level: 2
// FIXME i18n change text in master
text: i18n("Settings for %1", " ")
}
Controls.ComboBox {
model: kcm.outputModel
textRole: "display"
currentIndex: root.selectedOutput
onActivated: {
root.selectedOutput = index
currentIndex = Qt.binding(function() {
return root.selectedOutput;
});
}
}
}
Controls.SwipeView {
id: panelView
currentIndex: root.selectedOutput
......@@ -44,7 +69,7 @@ ColumnLayout {
visible: count > 1
count: panelView.count
currentIndex: panelView.currentIndex
currentIndex: root.selectedOutput
interactive: true
onCurrentIndexChanged: root.selectedOutput = currentIndex
}
......
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