updated menu stack

This commit is contained in:
Dante Ruiz 2017-02-15 18:57:06 +00:00
parent 2a97ebb076
commit b50bc99cbd
2 changed files with 16 additions and 3 deletions

View file

@ -64,6 +64,7 @@ FocusScope {
// navigate back to root level menu
onClicked: {
buildMenu();
breadcrumbText.text = "Menu";
tabletRoot.playButtonClickSound();
}
}
@ -106,10 +107,13 @@ FocusScope {
function setRootMenu(menu) {
tabletMenu.rootMenu = menu
buildMenu()
buildMenu();
}
function buildMenu() {
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> updated menu stack
// Build submenu if specified.
if (subMenu !== "") {
var index = 0;
@ -122,15 +126,19 @@ FocusScope {
}
subMenu = ""; // Continue with full menu after initially displaying submenu.
if (found) {
menuPopperUpper.popup(tabletMenu, rootMenu.items[index].items);
menuPopperUpper.popup(rootMenu.items[index].items);
return;
}
}
// Otherwise build whole menu.
<<<<<<< HEAD
menuPopperUpper.popup(tabletMenu, rootMenu.items);
=======
menuPopperUpper.popup(rootMenu.items);
>>>>>>> updating branch with master
=======
menuPopperUpper.popup(rootMenu.items);
>>>>>>> updated menu stack
}
}

View file

@ -27,12 +27,13 @@ Item {
d.clearMenus();
}
}
StackView {
anchors.fill: parent
id: d
objectName: "stack"
initialItem: topMenu
property var menuStack: []
property var topMenu: null;
property var modelMaker: Component { ListModel { } }
@ -57,9 +58,13 @@ Item {
}
function pushSource(path) {
d.push(Qt.resolvedUrl(path));
d.currentItem.eventBridge = tabletMenu.eventBridge
d.currentItem.sendToScript.connect(tabletMenu.sendToScript);
}
function popSource() {
d.pop();
}
function toModel(items) {