From ef699db5be91664681ded0dc7cd4a58280ce731b Mon Sep 17 00:00:00 2001 From: Faye Li Si Fi Date: Thu, 12 Jan 2017 16:14:37 -0800 Subject: [PATCH] nav bar menu now bring you back to menu root --- .../resources/qml/hifi/tablet/TabletMenu.qml | 51 +++++++++++++++- .../qml/hifi/tablet/TabletMenuView.qml | 58 ------------------- 2 files changed, 48 insertions(+), 61 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletMenu.qml b/interface/resources/qml/hifi/tablet/TabletMenu.qml index 36de421a78..b4cfc65ccf 100644 --- a/interface/resources/qml/hifi/tablet/TabletMenu.qml +++ b/interface/resources/qml/hifi/tablet/TabletMenu.qml @@ -4,19 +4,64 @@ import QtQuick.Controls 1.4 import QtQml 2.2 import "." - Item { id: tabletMenu objectName: "tabletMenu" - width: parent.width - height: parent.height + width: 480 + height: 720 property var rootMenu: Menu { objectName:"rootMenu" } property var point: Qt.point(50, 50) TabletMouseHandler { id: menuPopperUpper } + Rectangle { + id: bgNavBar + height: 90 + z: 1 + gradient: Gradient { + GradientStop { + position: 0 + color: "#2b2b2b" + } + + GradientStop { + position: 1 + color: "#1e1e1e" + } + } + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.topMargin: 0 + anchors.top: parent.top + + Image { + id: menuRootIcon + width: 40 + height: 40 + source: "../../../icons/tablet-icons/menu-i.svg" + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 15 + + MouseArea { + anchors.fill: parent + // navigate back to top level menu + onClicked: buildMenu(); + } + } + + ColorOverlay { + id: iconColorOverlay + anchors.fill: menuRootIcon + source: menuRootIcon + color: "#ffffff" + } + } + function setRootMenu(menu) { tabletMenu.rootMenu = menu buildMenu() diff --git a/interface/resources/qml/hifi/tablet/TabletMenuView.qml b/interface/resources/qml/hifi/tablet/TabletMenuView.qml index 0c183be3dc..4038ba060a 100644 --- a/interface/resources/qml/hifi/tablet/TabletMenuView.qml +++ b/interface/resources/qml/hifi/tablet/TabletMenuView.qml @@ -11,7 +11,6 @@ import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 -import QtGraphicalEffects 1.0 import "../../styles-uit" @@ -27,63 +26,6 @@ FocusScope { HifiConstants { id: hifi } - Rectangle { - id: bgNavBar - height: 90 - z: 1 - gradient: Gradient { - GradientStop { - position: 0 - color: "#2b2b2b" - } - - GradientStop { - position: 1 - color: "#1e1e1e" - } - } - anchors.right: parent.right - anchors.rightMargin: 0 - anchors.left: parent.left - anchors.leftMargin: 0 - anchors.topMargin: 0 - anchors.top: parent.top - - Image { - id: menuRootIcon - width: 40 - height: 40 - source: "../../../icons/tablet-icons/menu-i.svg" - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: 15 - - MouseArea { - anchors.fill: parent - // TODO: navigate back to top level menu - onClicked: iconColorOverlay.color = "#1fc6a6" - } - } - - ColorOverlay { - id: iconColorOverlay - anchors.fill: menuRootIcon - source: menuRootIcon - color: "#ffffff" - } - - RalewayBold { - id: breadcrumbText - text: "MENU" - size: 18 - color: "#ffffff" - anchors.verticalCenter: parent.verticalCenter - anchors.left: menuRootIcon.right - anchors.leftMargin: 15 - } - - } - Rectangle { id: background anchors.fill: listView