updated menu stack

This commit is contained in:
Dante Ruiz 2017-02-15 18:57:06 +00:00
parent 485592751f
commit e6853a9255
2 changed files with 11 additions and 9 deletions

View file

@ -19,7 +19,7 @@ FocusScope {
height: 720
property var rootMenu: Menu { objectName:"rootMenu" }
property var point: Qt.point(50, 50)
property var point: Qt.point(50, 50);
property var eventBridge;
signal sendToScript(var message);
TabletMenuStack { id: menuPopperUpper }
@ -64,6 +64,7 @@ FocusScope {
// navigate back to root level menu
onClicked: {
buildMenu();
breadcrumbText.text = "Menu";
tabletRoot.playButtonClickSound();
}
}
@ -106,12 +107,9 @@ FocusScope {
function setRootMenu(menu) {
tabletMenu.rootMenu = menu
buildMenu()
buildMenu();
}
function buildMenu() {
<<<<<<< HEAD
menuPopperUpper.popup(rootMenu.items);
=======
// Build submenu if specified.
if (subMenu !== "") {
var index = 0;
@ -124,13 +122,12 @@ 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.
menuPopperUpper.popup(tabletMenu, rootMenu.items);
>>>>>>> 01bdac49d04ec897a3da7a264a1a26748a4e1938
menuPopperUpper.popup(rootMenu.items);
}
}

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) {