mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge pull request #13886 from ctrlaltdavid/M17901
Improve HMD Menu page navigation
This commit is contained in:
commit
cb33222fea
8 changed files with 36 additions and 32 deletions
|
@ -26,7 +26,7 @@ Rectangle {
|
||||||
HifiConstants { id: hifi; }
|
HifiConstants { id: hifi; }
|
||||||
|
|
||||||
property var eventBridge;
|
property var eventBridge;
|
||||||
property string title: "Audio Settings - " + AudioScriptingInterface.context;
|
property string title: "Audio Settings"
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
color: hifi.colors.baseGray;
|
color: hifi.colors.baseGray;
|
||||||
|
|
|
@ -18,6 +18,7 @@ import "../../windows"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
objectName: "DCConectionTiming"
|
objectName: "DCConectionTiming"
|
||||||
|
property string title: "Domain Connection Timing"
|
||||||
|
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
property bool isHMD: false
|
property bool isHMD: false
|
||||||
|
@ -33,7 +34,7 @@ Rectangle {
|
||||||
Row {
|
Row {
|
||||||
id: header
|
id: header
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: hifi.dimensions.tabletMenuHeader
|
anchors.topMargin: hifi.dimensions.contentMargin.y
|
||||||
anchors.leftMargin: 5
|
anchors.leftMargin: 5
|
||||||
anchors.rightMargin: 5
|
anchors.rightMargin: 5
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
|
@ -18,6 +18,7 @@ import "../../windows"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
objectName: "EntityStatistics"
|
objectName: "EntityStatistics"
|
||||||
|
property string title: "Entity Statistics"
|
||||||
|
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
property bool isHMD: false
|
property bool isHMD: false
|
||||||
|
@ -40,6 +41,7 @@ Rectangle {
|
||||||
id: scrollView
|
id: scrollView
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: hifi.dimensions.contentMargin.y
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: hifi.dimensions.tabletMenuHeader
|
anchors.bottomMargin: hifi.dimensions.tabletMenuHeader
|
||||||
contentWidth: column.implicitWidth
|
contentWidth: column.implicitWidth
|
||||||
|
@ -48,10 +50,15 @@ Rectangle {
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: column
|
id: column
|
||||||
anchors.margins: 10
|
anchors.top: parent.top
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
y: hifi.dimensions.tabletMenuHeader //-bgNavBar
|
anchors {
|
||||||
|
topMargin: 0
|
||||||
|
leftMargin: 10
|
||||||
|
rightMargin: 10
|
||||||
|
bottomMargin: 0
|
||||||
|
}
|
||||||
spacing: 20
|
spacing: 20
|
||||||
|
|
||||||
TabletEntityStatisticsItem {
|
TabletEntityStatisticsItem {
|
||||||
|
|
|
@ -24,6 +24,8 @@ Item {
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
|
property string title: "Controls"
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
TabBar {
|
TabBar {
|
||||||
|
|
|
@ -23,6 +23,8 @@ FocusScope {
|
||||||
property string subMenu: ""
|
property string subMenu: ""
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: bgNavBar
|
id: bgNavBar
|
||||||
height: 90
|
height: 90
|
||||||
|
@ -45,24 +47,22 @@ FocusScope {
|
||||||
anchors.topMargin: 0
|
anchors.topMargin: 0
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
|
||||||
Image {
|
HiFiGlyphs {
|
||||||
id: menuRootIcon
|
id: menuRootIcon
|
||||||
width: 40
|
text: breadcrumbText.text !== "Menu" ? hifi.glyphs.backward : ""
|
||||||
height: 40
|
size: 72
|
||||||
source: "../../../icons/tablet-icons/menu-i.svg"
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 15
|
width: breadcrumbText.text === "Menu" ? 32 : 50
|
||||||
|
visible: breadcrumbText.text !== "Menu"
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: iconColorOverlay.color = "#1fc6a6";
|
onEntered: iconColorOverlay.color = "#1fc6a6";
|
||||||
onExited: iconColorOverlay.color = "#34a2c7";
|
onExited: iconColorOverlay.color = "#34a2c7";
|
||||||
// navigate back to root level menu
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
buildMenu();
|
menuPopperUpper.closeLastMenu();
|
||||||
breadcrumbText.text = "Menu";
|
|
||||||
tabletRoot.playButtonClickSound();
|
tabletRoot.playButtonClickSound();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,23 +79,10 @@ FocusScope {
|
||||||
id: breadcrumbText
|
id: breadcrumbText
|
||||||
text: "Menu"
|
text: "Menu"
|
||||||
size: 26
|
size: 26
|
||||||
color: "#34a2c7"
|
color: "#e3e3e3"
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: menuRootIcon.right
|
anchors.left: menuRootIcon.right
|
||||||
anchors.leftMargin: 15
|
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();
|
menuPopperUpper.closeLastMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function setRootMenu(rootMenu, subMenu) {
|
function setRootMenu(rootMenu, subMenu) {
|
||||||
tabletMenu.subMenu = subMenu;
|
tabletMenu.subMenu = subMenu;
|
||||||
tabletMenu.rootMenu = rootMenu;
|
tabletMenu.rootMenu = rootMenu;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//
|
//
|
||||||
// MessageDialog.qml
|
// TabletMenuStack.qml
|
||||||
//
|
//
|
||||||
// Created by Dante Ruiz on 13 Feb 2017
|
// Created by Dante Ruiz on 13 Feb 2017
|
||||||
// Copyright 2016 High Fidelity, Inc.
|
// Copyright 2016 High Fidelity, Inc.
|
||||||
|
@ -66,7 +66,7 @@ Item {
|
||||||
|
|
||||||
function popSource() {
|
function popSource() {
|
||||||
console.log("trying to pop page");
|
console.log("trying to pop page");
|
||||||
d.pop();
|
closeLastMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
function toModel(items, newMenu) {
|
function toModel(items, newMenu) {
|
||||||
|
|
|
@ -41,7 +41,11 @@ Item {
|
||||||
section.saveAll();
|
section.saveAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
closeDialog();
|
if (HMD.active) {
|
||||||
|
tablet.popFromStack();
|
||||||
|
} else {
|
||||||
|
closeDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function restoreAll() {
|
function restoreAll() {
|
||||||
|
@ -50,7 +54,11 @@ Item {
|
||||||
section.restoreAll();
|
section.restoreAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
closeDialog();
|
if (HMD.active) {
|
||||||
|
tablet.popFromStack();
|
||||||
|
} else {
|
||||||
|
closeDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
|
|
|
@ -255,7 +255,7 @@ Menu::Menu() {
|
||||||
connect(action, &QAction::triggered, [] {
|
connect(action, &QAction::triggered, [] {
|
||||||
auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
|
auto tablet = DependencyManager::get<TabletScriptingInterface>()->getTablet("com.highfidelity.interface.tablet.system");
|
||||||
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
auto hmd = DependencyManager::get<HMDScriptingInterface>();
|
||||||
tablet->loadQMLSource("hifi/tablet/ControllerSettings.qml");
|
tablet->pushOntoStack("hifi/tablet/ControllerSettings.qml");
|
||||||
|
|
||||||
if (!hmd->getShouldShowTablet()) {
|
if (!hmd->getShouldShowTablet()) {
|
||||||
hmd->toggleShouldShowTablet();
|
hmd->toggleShouldShowTablet();
|
||||||
|
|
Loading…
Reference in a new issue