a close signal

This commit is contained in:
Marco Martin 2020-02-04 20:44:58 +01:00
parent fd88b7add1
commit b10d1ef5c6
3 changed files with 11 additions and 0 deletions

View file

@ -259,6 +259,9 @@ PlasmaCore.ColorScope {
z: 1
contentItem: QuickSettings {
id: quickSettings
onCloseRequested: {
slidingPanel.hide()
}
}
}

View file

@ -26,6 +26,7 @@ ColumnLayout {
id: delegateRoot
property bool toggled: model.enabled
spacing: units.smallSpacing
signal closeRequested
Rectangle {
Layout.preferredWidth: units.iconSizes.large + units.smallSpacing * 2
@ -93,6 +94,7 @@ ColumnLayout {
onClicked: {
if (model.settingsCommand) {
plasmoid.nativeInterface.executeCommand(model.settingsCommand);
closeRequested();
} else if (model.toggleFunction) {
root[model.toggleFunction]();
}

View file

@ -28,6 +28,8 @@ Item {
implicitWidth: flow.implicitWidth + units.smallSpacing * 6
implicitHeight: flow.implicitHeight + units.smallSpacing * 6
signal closeRequested
function toggleAirplane() {
print("toggle airplane mode")
}
@ -195,6 +197,10 @@ Item {
width: flow.columnWidth
height: item ? item.implicitHeight : 0
source: Qt.resolvedUrl((model.delegate ? model.delegate : "Delegate") + ".qml")
Connections {
target: item
onCloseRequested: root.closeRequested()
}
}
}
move: Transition {