nav bar menu now bring you back to menu root

This commit is contained in:
Faye Li Si Fi 2017-01-12 16:14:37 -08:00
parent 99b6c6f1fd
commit ef699db5be
2 changed files with 48 additions and 61 deletions

View file

@ -4,19 +4,64 @@ import QtQuick.Controls 1.4
import QtQml 2.2 import QtQml 2.2
import "." import "."
Item { Item {
id: tabletMenu id: tabletMenu
objectName: "tabletMenu" objectName: "tabletMenu"
width: parent.width width: 480
height: parent.height height: 720
property var rootMenu: Menu { objectName:"rootMenu" } property var rootMenu: Menu { objectName:"rootMenu" }
property var point: Qt.point(50, 50) property var point: Qt.point(50, 50)
TabletMouseHandler { id: menuPopperUpper } 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) { function setRootMenu(menu) {
tabletMenu.rootMenu = menu tabletMenu.rootMenu = menu
buildMenu() buildMenu()

View file

@ -11,7 +11,6 @@
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.0
import "../../styles-uit" import "../../styles-uit"
@ -27,63 +26,6 @@ FocusScope {
HifiConstants { id: hifi } 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 { Rectangle {
id: background id: background
anchors.fill: listView anchors.fill: listView