MiddlePanel: add an optional onPageClosed callback

to match onPageCompleted
This commit is contained in:
moneromooo.monero 2016-11-21 14:58:53 +00:00
parent 26abdee5c4
commit af4e49cd0f

View file

@ -39,6 +39,7 @@ Rectangle {
id: root id: root
property Item currentView property Item currentView
property Item previousView
property bool basicMode : false property bool basicMode : false
property string balanceText property string balanceText
property string unlockedBalanceText property string unlockedBalanceText
@ -62,6 +63,12 @@ Rectangle {
color: "#F0EEEE" color: "#F0EEEE"
onCurrentViewChanged: { onCurrentViewChanged: {
if (previousView) {
if (typeof previousView.onPageClosed === "function") {
previousView.onPageClosed();
}
}
previousView = currentView
if (currentView) { if (currentView) {
stackView.replace(currentView) stackView.replace(currentView)