diff --git a/interface/resources/icons/connection.svg b/interface/resources/icons/connection.svg new file mode 100644 index 0000000000..05b23abf9a --- /dev/null +++ b/interface/resources/icons/connection.svg @@ -0,0 +1,48 @@ + + + + + + + + diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index d5e26e22cf..4d03059cb3 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -977,6 +977,78 @@ Rectangle { } } } + + // "Make a Connection" instructions + Rectangle { + id: connectionInstructions; + visible: connectionsTable.rowCount === 0 && !connectionsLoading.visible; + anchors.fill: connectionsTable; + anchors.topMargin: hifi.dimensions.tableHeaderHeight; + color: "white"; + + RalewayRegular { + id: makeAConnectionText; + // Properties + text: "Make a Connection"; + // Anchors + anchors.top: parent.top; + anchors.topMargin: 60; + anchors.left: parent.left; + anchors.right: parent.right; + // Text Size + size: 24; + // Text Positioning + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter; + // Style + color: hifi.colors.darkGray; + } + + Image { + id: connectionImage; + source: "../../icons/connection.svg"; + width: 150; + height: 150; + mipmap: true; + // Anchors + anchors.top: makeAConnectionText.bottom; + anchors.topMargin: 15; + anchors.horizontalCenter: parent.horizontalCenter; + } + + FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } + Text { + id: connectionHelpText; + // Anchors + anchors.top: connectionImage.bottom; + anchors.topMargin: 15; + anchors.left: parent.left + anchors.leftMargin: 40; + anchors.right: parent.right + anchors.rightMargin: 10; + // Text alignment + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHLeft + // Style + font.pixelSize: 18; + font.family: ralewayRegular.name + color: hifi.colors.darkGray + wrapMode: Text.WordWrap + textFormat: Text.StyledText; + // Text + text: HMD.active ? + "When you meet someone you want to remember later, you can connect with a handshake:

" + + "1. Put your hand out onto their hand and squeeze your controller's grip button on its side.
" + + "2. Once the other person puts their hand onto yours, you'll see your connection form.
" + + "3. After about 3 seconds, you're connected!" + : + "When you meet someone you want to remember later, you can connect with a handshake:

" + + "1. Press and hold the 'x' key to extend your arm.
" + + "2. Once the other person puts their hand onto yours, you'll see your connection form.
" + + "3. After about 3 seconds, you're connected!"; + } + + } } // "Connections" Tab } // palTabContainer diff --git a/scripts/system/pal.js b/scripts/system/pal.js index 63d59f5719..f9182c3286 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -690,7 +690,6 @@ function startup() { tablet.fromQml.connect(fromQml); button.clicked.connect(onTabletButtonClicked); tablet.screenChanged.connect(onTabletScreenChanged); - tablet.tabletShownChanged.connect(tabletVisibilityChanged); Users.usernameFromIDReply.connect(usernameFromIDReply); Window.domainChanged.connect(clearLocalQMLDataAndClosePAL); Window.domainConnectionRefused.connect(clearLocalQMLDataAndClosePAL); @@ -713,6 +712,7 @@ function off() { Script.update.disconnect(updateOverlays); Controller.mousePressEvent.disconnect(handleMouseEvent); Controller.mouseMoveEvent.disconnect(handleMouseMoveEvent); + tablet.tabletShownChanged.disconnect(tabletVisibilityChanged); isWired = false; } if (audioTimer) { @@ -725,10 +725,8 @@ function off() { } function tabletVisibilityChanged() { - if (tablet.tabletShown) { - onTabletButtonClicked(); - } else { - off(); + if (!tablet.tabletShown) { + tablet.gotoHomeScreen(); } } @@ -742,6 +740,7 @@ function onTabletButtonClicked() { } else { shouldActivateButton = true; tablet.loadQMLSource("../Pal.qml"); + tablet.tabletShownChanged.connect(tabletVisibilityChanged); onPalScreen = true; Users.requestsDomainListData = true; populateNearbyUserList(); @@ -877,7 +876,6 @@ function shutdown() { button.clicked.disconnect(onTabletButtonClicked); tablet.removeButton(button); tablet.screenChanged.disconnect(onTabletScreenChanged); - tablet.tabletShownChanged.disconnect(tabletVisibilityChanged); Users.usernameFromIDReply.disconnect(usernameFromIDReply); Window.domainChanged.disconnect(clearLocalQMLDataAndClosePAL); Window.domainConnectionRefused.disconnect(clearLocalQMLDataAndClosePAL);