Verified Commit 4dbf4dba authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

Simplify QuickSettings

parent 162f93a4
......@@ -31,13 +31,11 @@ ColumnLayout {
signal panelClosed
// Model interface
required property string text;
required property string icon;
required property bool enabled;
required property string settingsCommand;
required property var toggleFunction;
required property string delegate;
required property QtObject applet;
required property string text
required property string icon
required property bool enabled
required property string settingsCommand
required property var toggleFunction
Rectangle {
Layout.preferredWidth: units.iconSizes.large + units.smallSpacing
......
......@@ -93,15 +93,6 @@ Item {
return service.startOperationCall(operation);
}
function addPlasmoid(applet) {
settingsModel.append({"icon": applet.icon,
"text": applet.title,
"enabled": false,
"applet": applet,
"settingsCommand": "",
"toggleFunction": ""});
}
signal plasmoidTriggered(var applet, var id)
Layout.minimumHeight: flow.implicitHeight + units.largeSpacing*2
......@@ -159,7 +150,6 @@ Item {
"enabled": false,
"settingsCommand": "plasma-settings",
"toggleFunction": "",
"delegate": "",
"applet": null
});
settingsModel.append({
......@@ -167,7 +157,6 @@ Item {
"icon": "network-wireless-signal",
"settingsCommand": "plasma-settings -m kcm_mobile_wifi",
"toggleFunction": "toggleWifi",
"delegate": "",
"enabled": enabledConnections.wirelessEnabled,
"applet": null
});
......@@ -185,7 +174,6 @@ Item {
"icon": "network-modem",
"settingsCommand": "plasma-settings -m kcm_mobile_broadband",
"toggleFunction": "toggleWwan",
"delegate": "",
"enabled": enabledConnections.wwanEnabled,
"applet": null
});
......@@ -195,7 +183,6 @@ Item {
"enabled": false,
"settingsCommand": "plasma-settings -m kcm_mobile_power",
"toggleFunction": "",
"delegate": "",
"applet": null
});
settingsModel.append({
......@@ -204,7 +191,6 @@ Item {
"enabled": false,
"settingsCommand": "plasma-settings -m kcm_pulseaudio",
"toggleFunction": "",
"delegate": "",
"applet": null
});
settingsModel.append({
......@@ -260,19 +246,20 @@ Item {
spacing: 0
Repeater {
model: settingsModel
delegate: Loader {
id: loader
delegate: Delegate {
id: delegateItem
//FIXME: why this is needed?
width: flow.columnWidth
height: item ? item.implicitHeight : 0
source: Qt.resolvedUrl((model.delegate ? model.delegate : "Delegate") + ".qml")
Connections {
target: loader.item
target: delegateItem
onCloseRequested: root.closeRequested();
}
Connections {
target: root
onClosed: loader.item.panelClosed();
onClosed: delegateItem.panelClosed();
}
}
}
......
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