support close button for activity switcher

This commit is contained in:
Marco Martin 2013-10-24 12:00:35 +02:00
parent 177f000c66
commit 7edc668961
2 changed files with 14 additions and 1 deletions

View File

@ -18,7 +18,19 @@
*/
import QtQuick 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
Rectangle {
id: root
color: "red"
signal closed()
PlasmaComponents.ToolButton {
anchors {
top: parent.top
right: parent.right
}
iconSource: "window-close"
onClicked: root.closed()
}
}

View File

@ -53,7 +53,8 @@ Rectangle {
if (sidePanelStack.state == "activityManager") {
sidePanelStack.state = "closed";
} else {
sidePanelStack.push(Qt.resolvedUrl("../activitymanager/ActivityManager.qml"));
var page = sidePanelStack.push(Qt.resolvedUrl("../activitymanager/ActivityManager.qml"));
page.closed.connect(function(){sidePanelStack.state = "closed";});
sidePanelStack.state = "activityManager";
}
}