Merge pull request #13886 from ctrlaltdavid/M17901

Improve HMD Menu page navigation
This commit is contained in:
Seth Alves 2018-09-10 11:34:21 -07:00 committed by GitHub
commit cb33222fea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 32 deletions

View file

@ -26,7 +26,7 @@ Rectangle {
HifiConstants { id: hifi; }
property var eventBridge;
property string title: "Audio Settings - " + AudioScriptingInterface.context;
property string title: "Audio Settings"
signal sendToScript(var message);
color: hifi.colors.baseGray;

View file

@ -18,6 +18,7 @@ import "../../windows"
Rectangle {
id: root
objectName: "DCConectionTiming"
property string title: "Domain Connection Timing"
signal sendToScript(var message);
property bool isHMD: false
@ -33,7 +34,7 @@ Rectangle {
Row {
id: header
anchors.top: parent.top
anchors.topMargin: hifi.dimensions.tabletMenuHeader
anchors.topMargin: hifi.dimensions.contentMargin.y
anchors.leftMargin: 5
anchors.rightMargin: 5
anchors.left: parent.left

View file

@ -18,6 +18,7 @@ import "../../windows"
Rectangle {
id: root
objectName: "EntityStatistics"
property string title: "Entity Statistics"
signal sendToScript(var message);
property bool isHMD: false
@ -40,6 +41,7 @@ Rectangle {
id: scrollView
width: parent.width
anchors.top: parent.top
anchors.topMargin: hifi.dimensions.contentMargin.y
anchors.bottom: parent.bottom
anchors.bottomMargin: hifi.dimensions.tabletMenuHeader
contentWidth: column.implicitWidth
@ -48,10 +50,15 @@ Rectangle {
Column {
id: column
anchors.margins: 10
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
y: hifi.dimensions.tabletMenuHeader //-bgNavBar
anchors {
topMargin: 0
leftMargin: 10
rightMargin: 10
bottomMargin: 0
}
spacing: 20
TabletEntityStatisticsItem {

View file

@ -24,6 +24,8 @@ Item {
height: parent.height
width: parent.width
property string title: "Controls"
HifiConstants { id: hifi }
TabBar {

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: breadcrumbText.text !== "Menu" ? hifi.glyphs.backward : ""
size: 72
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 15
width: breadcrumbText.text === "Menu" ? 32 : 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();
}
}
@ -79,23 +79,10 @@ FocusScope {
id: breadcrumbText
text: "Menu"
size: 26
color: "#34a2c7"
color: "#e3e3e3"
anchors.verticalCenter: parent.verticalCenter
anchors.left: menuRootIcon.right
anchors.leftMargin: 15
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: breadcrumbText.color = "#1fc6a6";
onExited: breadcrumbText.color = "#34a2c7";
// navigate back to parent level menu if there is one
onClicked: {
if (breadcrumbText.text !== "Menu") {
menuPopperUpper.closeLastMenu();
}
tabletRoot.playButtonClickSound();
}
}
}
}
@ -103,7 +90,6 @@ FocusScope {
menuPopperUpper.closeLastMenu();
}
function setRootMenu(rootMenu, subMenu) {
tabletMenu.subMenu = subMenu;
tabletMenu.rootMenu = rootMenu;

View file

@ -1,5 +1,5 @@
//
// MessageDialog.qml
// TabletMenuStack.qml
//
// Created by Dante Ruiz on 13 Feb 2017
// Copyright 2016 High Fidelity, Inc.
@ -66,7 +66,7 @@ Item {
function popSource() {
console.log("trying to pop page");
d.pop();
closeLastMenu();
}
function toModel(items, newMenu) {

View file

@ -41,7 +41,11 @@ Item {
section.saveAll();
}
closeDialog();
if (HMD.active) {
tablet.popFromStack();
} else {
closeDialog();
}
}
function restoreAll() {
@ -50,7 +54,11 @@ Item {
section.restoreAll();
}
closeDialog();
if (HMD.active) {
tablet.popFromStack();
} else {
closeDialog();
}
}
function closeDialog() {

View file

@ -255,7 +255,7 @@ Menu::Menu() {
connect(action, &QAction::triggered, [] {
auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
auto hmd = DependencyManager::get<HMDScriptingInterface>();
tablet->loadQMLSource("hifi/tablet/ControllerSettings.qml");
tablet->pushOntoStack("hifi/tablet/ControllerSettings.qml");
if (!hmd->getShouldShowTablet()) {
hmd->toggleShouldShowTablet();