From d04b1da1c2fe8a6aaff42512e0a8c424d0526786 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 13 Mar 2017 12:54:01 -0700 Subject: [PATCH] Merging from PAL_v2_Zach --- interface/resources/qml/hifi/NameCard.qml | 6 +- interface/resources/qml/hifi/Pal.qml | 137 ++++++++++++++++++++-- 2 files changed, 132 insertions(+), 11 deletions(-) diff --git a/interface/resources/qml/hifi/NameCard.qml b/interface/resources/qml/hifi/NameCard.qml index fcde5817fc..aa908c0039 100644 --- a/interface/resources/qml/hifi/NameCard.qml +++ b/interface/resources/qml/hifi/NameCard.qml @@ -91,10 +91,8 @@ Item { enabled: selected || isMyCard; hoverEnabled: enabled onClicked: { - /* - THIS WILL OPEN THE BROWSER TO THE USER'S INFO PAGE! - I've no idea how to do this yet.. - */ + userInfoViewer.url = "http://highfidelity.com/users/" + (pal.activeTab == "nearbyTab" ? userName : displayName); // Connections tab puts username in "displayname" field + userInfoViewer.visible = true; } } } diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 5fb11b4e2f..8bd6824246 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -934,15 +934,138 @@ Rectangle { } } // Keyboard - /* - THIS WILL BE THE BROWSER THAT OPENS THE USER'S INFO PAGE! - I've no idea how to do this yet.. + Item { + id: webViewContainer; + anchors.fill: parent; - HifiTablet.TabletAddressDialog { - id: userInfoViewer; - visible: false; + Rectangle { + id: navigationContainer; + visible: userInfoViewer.visible; + height: 75; + anchors { + top: parent.top; + left: parent.left; + right: parent.right; + } + color: hifi.colors.faintGray; + + Item { + id: backButton + anchors { + top: parent.top; + left: parent.left; + } + height: parent.height - urlBar.height; + width: parent.width/2; + + FiraSansSemiBold { + // Properties + text: "BACK"; + elide: Text.ElideRight; + // Anchors + anchors.fill: parent; + // Text Size + size: 16; + // Text Positioning + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter; + // Style + color: backButtonMouseArea.containsMouse || !userInfoViewer.canGoBack ? hifi.colors.lightGray : hifi.colors.darkGray; + MouseArea { + id: backButtonMouseArea; + anchors.fill: parent + hoverEnabled: enabled + onClicked: userInfoViewer.goBack(); + } + } + } + + Item { + id: closeButton + anchors { + top: parent.top; + right: parent.right; + } + height: parent.height - urlBar.height; + width: parent.width/2; + + FiraSansSemiBold { + // Properties + text: "CLOSE"; + elide: Text.ElideRight; + // Anchors + anchors.fill: parent; + // Text Size + size: 16; + // Text Positioning + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter; + // Style + color: closeButtonMouseArea.containsMouse ? hifi.colors.lightGray : hifi.colors.darkGray; + MouseArea { + id: closeButtonMouseArea; + anchors.fill: parent + hoverEnabled: enabled + onClicked: userInfoViewer.visible = false; + } + } + } + + Item { + id: urlBar + anchors { + top: closeButton.bottom; + left: parent.left; + right: parent.right; + } + height: 25; + width: parent.width; + + FiraSansRegular { + // Properties + text: userInfoViewer.url; + elide: Text.ElideRight; + // Anchors + anchors.fill: parent; + // Text Size + size: 14; + // Text Positioning + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter; + // Style + color: hifi.colors.lightGray; + MouseArea { + anchors.fill: parent + onClicked: userInfoViewer.visible = false; + } + } + } + } + + Rectangle { + id: webViewBackground; + color: "white"; + visible: userInfoViewer.visible; + anchors { + top: navigationContainer.bottom; + bottom: parent.bottom; + left: parent.left; + right: parent.right; + } + } + + HifiControls.WebView { + id: userInfoViewer; + anchors { + top: navigationContainer.bottom; + topMargin: 5; + bottom: parent.bottom; + left: parent.left; + right: parent.right; + } + visible: false; + } } - */ } // PAL container