Make tablet menu page title navigation go back a level

This commit is contained in:
David Rowe 2018-08-31 16:58:59 +12:00
parent ed441d5570
commit f144308334

View file

@ -23,6 +23,8 @@ FocusScope {
property string subMenu: ""
signal sendToScript(var message);
HifiConstants { id: hifi }
Rectangle {
id: bgNavBar
height: 90
@ -45,24 +47,22 @@ FocusScope {
anchors.topMargin: 0
anchors.top: parent.top
Image {
HiFiGlyphs {
id: menuRootIcon
width: 40
height: 40
source: "../../../icons/tablet-icons/menu-i.svg"
text: hifi.glyphs.backward
size: 72
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 15
width: breadcrumbText.text === "Menu" ? 15 : 50
visible: breadcrumbText.text !== "Menu"
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: iconColorOverlay.color = "#1fc6a6";
onExited: iconColorOverlay.color = "#34a2c7";
// navigate back to root level menu
onClicked: {
buildMenu();
breadcrumbText.text = "Menu";
menuPopperUpper.closeLastMenu();
tabletRoot.playButtonClickSound();
}
}
@ -103,7 +103,6 @@ FocusScope {
menuPopperUpper.closeLastMenu();
}
function setRootMenu(rootMenu, subMenu) {
tabletMenu.subMenu = subMenu;
tabletMenu.rootMenu = rootMenu;