mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 05:52:38 +02:00
toggle goto in tablet
This commit is contained in:
parent
5bb4edf18c
commit
52fd446d4d
5 changed files with 31 additions and 17 deletions
|
@ -243,12 +243,7 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
DropShadow {
|
||||
anchors.fill: actionIcon
|
||||
radius: 8.0
|
||||
color: "#80000000"
|
||||
source: actionIcon
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: messageArea;
|
||||
width: rectIcon.width;
|
||||
|
|
|
@ -25,22 +25,31 @@ StackView {
|
|||
HifiConstants { id: hifi }
|
||||
HifiStyles.HifiConstants { id: hifiStyleConstants }
|
||||
initialItem: addressBarDialog
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
property var eventBridge;
|
||||
property var allStories: [];
|
||||
property int cardWidth: 460;
|
||||
property int cardHeight: 320;
|
||||
property string metaverseBase: addressBarDialog.metaverseServerUrl + "/api/v1/";
|
||||
|
||||
property var tablet: null;
|
||||
property bool isDesktop: false;
|
||||
|
||||
Component { id: tabletStoryCard; TabletStoryCard {} }
|
||||
Component.onCompleted: {
|
||||
root.currentItem.focus = true;
|
||||
root.currentItem.forceActiveFocus();
|
||||
addressLine.focus = true;
|
||||
addressLine.forceActiveFocus();
|
||||
fillDestinations();
|
||||
updateLocationText(false);
|
||||
root.parentChanged.connect(center);
|
||||
center();
|
||||
isDesktop = (typeof desktop !== "undefined");
|
||||
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
|
||||
if (desktop) {
|
||||
root.title = "GOTO";
|
||||
}
|
||||
}
|
||||
Component.onDestruction: {
|
||||
root.parentChanged.disconnect(center);
|
||||
|
@ -107,7 +116,6 @@ StackView {
|
|||
imageURL: "../../../images/home.svg"
|
||||
onClicked: {
|
||||
addressBarDialog.loadHome();
|
||||
root.shown = false;
|
||||
}
|
||||
anchors {
|
||||
left: parent.left
|
||||
|
@ -291,9 +299,8 @@ StackView {
|
|||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: 10
|
||||
verticalCenter: parent.verticalCenter;
|
||||
horizontalCenter: parent.horizontalCenter;
|
||||
}
|
||||
|
||||
model: suggestions
|
||||
orientation: ListView.Vertical
|
||||
|
||||
|
@ -547,7 +554,13 @@ StackView {
|
|||
if (addressLine.text !== "") {
|
||||
addressBarDialog.loadAddress(addressLine.text, fromSuggestions)
|
||||
}
|
||||
root.shown = false;
|
||||
|
||||
if (root.desktop) {
|
||||
tablet.gotoHomeScreen();
|
||||
} else {
|
||||
HMD.closeTablet();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
|
|
|
@ -2010,6 +2010,7 @@ void Application::initializeUi() {
|
|||
rootContext->setContextProperty("SoundCache", DependencyManager::get<SoundCache>().data());
|
||||
|
||||
rootContext->setContextProperty("Account", AccountScriptingInterface::getInstance());
|
||||
rootContext->setContextProperty("Tablet", DependencyManager::get<TabletScriptingInterface>().data());
|
||||
rootContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
|
||||
rootContext->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance());
|
||||
rootContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
|
||||
|
|
|
@ -83,7 +83,7 @@ QQuickWindow* TabletScriptingInterface::getTabletWindow() {
|
|||
QObject* qmlSurface = tablet->getTabletSurface();
|
||||
OffscreenQmlSurface* surface = dynamic_cast<OffscreenQmlSurface*>(qmlSurface);
|
||||
|
||||
if (!surface) {
|
||||
if (!surface) {
|
||||
return nullptr;
|
||||
}
|
||||
QQuickWindow* window = surface->getWindow();
|
||||
|
|
|
@ -29,10 +29,15 @@
|
|||
}
|
||||
|
||||
function onScreenChanged(type, url) {
|
||||
// for toolbar mode: change button to active when window is first openend, false otherwise.
|
||||
button.editProperties({isActive: shouldActivateButton});
|
||||
shouldActivateButton = false;
|
||||
onGotoScreen = false;
|
||||
if (url === gotoQmlSource) {
|
||||
onGotoScreen = true;
|
||||
shouldActivateButton = true;
|
||||
button.editProperties({isActive: shouldActivateButton});
|
||||
} else {
|
||||
shouldActivateButton = false;
|
||||
onGotoScreen = false;
|
||||
button.editProperties({isActive: shouldActivateButton});
|
||||
}
|
||||
}
|
||||
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
|
|
Loading…
Reference in a new issue