Changeset View
Changeset View
Standalone View
Standalone View
kcm/package/contents/ui/Panel.qml
Show All 16 Lines | |||||
17 | import QtQuick 2.9 | 17 | import QtQuick 2.9 | ||
18 | import QtQuick.Layouts 1.1 | 18 | import QtQuick.Layouts 1.1 | ||
19 | import QtQuick.Controls 2.3 as Controls | 19 | import QtQuick.Controls 2.3 as Controls | ||
20 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 20 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
21 | import org.kde.kirigami 2.4 as Kirigami | 21 | import org.kde.kirigami 2.4 as Kirigami | ||
22 | import org.kde.private.kcm.kscreen 1.0 as KScreen | 22 | import org.kde.private.kcm.kscreen 1.0 as KScreen | ||
23 | 23 | | |||
24 | ColumnLayout { | 24 | ColumnLayout { | ||
25 | RowLayout { | ||||
26 | Layout.alignment: Qt.AlignHCenter | ||||
27 | spacing: 0 | ||||
28 | visible: kcm.outputModel.rowCount() > 1 | ||||
29 | | ||||
30 | Kirigami.Heading { | ||||
31 | horizontalAlignment: Text.AlignHCenter | ||||
32 | level: 2 | ||||
33 | // FIXME i18n change text in master | ||||
romangg: what does this FIXME mean? | |||||
Ideally the heading would be i18n("Settings for:") but you can't do string changes in stable and I don't want to request an exception for a minor inconvenience. broulik: Ideally the heading would be `i18n("Settings for:")` but you can't do string changes in stable… | |||||
34 | text: i18n("Settings for %1", " ") | ||||
35 | } | ||||
36 | | ||||
37 | Controls.ComboBox { | ||||
38 | model: kcm.outputModel | ||||
39 | textRole: "display" | ||||
40 | currentIndex: root.selectedOutput | ||||
41 | onActivated: { | ||||
42 | root.selectedOutput = index | ||||
43 | currentIndex = Qt.binding(function() { | ||||
44 | return root.selectedOutput; | ||||
45 | }); | ||||
46 | } | ||||
47 | } | ||||
48 | } | ||||
49 | | ||||
25 | Controls.SwipeView { | 50 | Controls.SwipeView { | ||
26 | id: panelView | 51 | id: panelView | ||
27 | currentIndex: root.selectedOutput | 52 | currentIndex: root.selectedOutput | ||
28 | 53 | | |||
29 | onCurrentIndexChanged: root.selectedOutput = | 54 | onCurrentIndexChanged: root.selectedOutput = | ||
30 | Qt.binding(function() { return currentIndex; }); | 55 | Qt.binding(function() { return currentIndex; }); | ||
31 | 56 | | |||
32 | Layout.fillWidth: true | 57 | Layout.fillWidth: true | ||
33 | 58 | | |||
34 | Repeater { | 59 | Repeater { | ||
35 | model: kcm.outputModel | 60 | model: kcm.outputModel | ||
36 | OutputPanel {} | 61 | OutputPanel {} | ||
37 | } | 62 | } | ||
38 | } | 63 | } | ||
39 | 64 | | |||
40 | Controls.PageIndicator { | 65 | Controls.PageIndicator { | ||
41 | id: indicator | 66 | id: indicator | ||
42 | 67 | | |||
43 | Layout.alignment: Qt.AlignHCenter | 68 | Layout.alignment: Qt.AlignHCenter | ||
44 | visible: count > 1 | 69 | visible: count > 1 | ||
45 | 70 | | |||
46 | count: panelView.count | 71 | count: panelView.count | ||
47 | currentIndex: panelView.currentIndex | 72 | currentIndex: root.selectedOutput | ||
48 | interactive: true | 73 | interactive: true | ||
49 | onCurrentIndexChanged: root.selectedOutput = currentIndex | 74 | onCurrentIndexChanged: root.selectedOutput = currentIndex | ||
50 | } | 75 | } | ||
51 | 76 | | |||
52 | Kirigami.FormLayout { | 77 | Kirigami.FormLayout { | ||
53 | id: globalSettingsLayout | 78 | id: globalSettingsLayout | ||
54 | Layout.fillWidth: true | 79 | Layout.fillWidth: true | ||
55 | 80 | | |||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |
what does this FIXME mean?