mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 16:41:02 +02:00
nav bar menu now bring you back to menu root
This commit is contained in:
parent
99b6c6f1fd
commit
ef699db5be
2 changed files with 48 additions and 61 deletions
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue