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 z: 1
contentItem: QuickSettings { contentItem: QuickSettings {
id: quickSettings id: quickSettings
onCloseRequested: {
slidingPanel.hide()
}
} }
} }

View file

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

View file

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