mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-23 03:58:49 +00:00
chore: make it possible to customize/remove the back button
This commit is contained in:
parent
3252eaf340
commit
c964e99b0c
@ -19,6 +19,21 @@ StatusModal {
|
|||||||
readonly property int itemsCount: stackLayout.count
|
readonly property int itemsCount: stackLayout.count
|
||||||
readonly property var currentItem: stackLayout.currentItem
|
readonly property var currentItem: stackLayout.currentItem
|
||||||
|
|
||||||
|
property Item backButton: StatusBackButton {
|
||||||
|
visible: replaceItem || stackLayout.currentIndex > 0
|
||||||
|
onClicked: {
|
||||||
|
if (replaceItem) {
|
||||||
|
replaceItem = null;
|
||||||
|
} else {
|
||||||
|
let prevAction = stackLayout.currentItem.prevAction
|
||||||
|
stackLayout.currentIndex--;
|
||||||
|
if (typeof(prevAction) == "function") {
|
||||||
|
prevAction()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
property Item nextButton: StatusButton {
|
property Item nextButton: StatusButton {
|
||||||
text: qsTr("Next")
|
text: qsTr("Next")
|
||||||
onClicked: root.currentIndex++
|
onClicked: root.currentIndex++
|
||||||
@ -52,21 +67,7 @@ StatusModal {
|
|||||||
? replaceLoader.item.title : stackTitle
|
? replaceLoader.item.title : stackTitle
|
||||||
padding: 16
|
padding: 16
|
||||||
|
|
||||||
leftButtons: StatusBackButton {
|
leftButtons: [ backButton ]
|
||||||
id: backButton
|
|
||||||
visible: replaceItem || stackLayout.currentIndex > 0
|
|
||||||
onClicked: {
|
|
||||||
if (replaceItem) {
|
|
||||||
replaceItem = null;
|
|
||||||
} else {
|
|
||||||
let prevAction = stackLayout.currentItem.prevAction
|
|
||||||
stackLayout.currentIndex--;
|
|
||||||
if (typeof(prevAction) == "function") {
|
|
||||||
prevAction()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rightButtons: [ nextButton, finishButton ]
|
rightButtons: [ nextButton, finishButton ]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user