diff --git a/interface/resources/qml/hifi/Card.qml b/interface/resources/qml/hifi/Card.qml index 217cfec707..b72901fbdf 100644 --- a/interface/resources/qml/hifi/Card.qml +++ b/interface/resources/qml/hifi/Card.qml @@ -243,12 +243,7 @@ Rectangle { } } } - DropShadow { - anchors.fill: actionIcon - radius: 8.0 - color: "#80000000" - source: actionIcon - } + MouseArea { id: messageArea; width: rectIcon.width; diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index b0b8c68789..fbb78d2694 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -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: { diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e19eea0a2e..feba5a74a7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2010,6 +2010,7 @@ void Application::initializeUi() { rootContext->setContextProperty("SoundCache", DependencyManager::get().data()); rootContext->setContextProperty("Account", AccountScriptingInterface::getInstance()); + rootContext->setContextProperty("Tablet", DependencyManager::get().data()); rootContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface); rootContext->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance()); rootContext->setContextProperty("FaceTracker", DependencyManager::get().data()); diff --git a/libraries/script-engine/src/TabletScriptingInterface.cpp b/libraries/script-engine/src/TabletScriptingInterface.cpp index 7747e1b6dc..3aa0cc99e7 100644 --- a/libraries/script-engine/src/TabletScriptingInterface.cpp +++ b/libraries/script-engine/src/TabletScriptingInterface.cpp @@ -83,7 +83,7 @@ QQuickWindow* TabletScriptingInterface::getTabletWindow() { QObject* qmlSurface = tablet->getTabletSurface(); OffscreenQmlSurface* surface = dynamic_cast(qmlSurface); - if (!surface) { + if (!surface) { return nullptr; } QQuickWindow* window = surface->getWindow(); diff --git a/scripts/system/tablet-goto.js b/scripts/system/tablet-goto.js index eb95d9d8a3..84f7357b1a 100644 --- a/scripts/system/tablet-goto.js +++ b/scripts/system/tablet-goto.js @@ -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");