From e3d0842ddcc8a9b4dc0d740016909ea2c5fe3f2e Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Mon, 13 Mar 2017 18:39:47 -0700 Subject: [PATCH] Implement browser in PAL --- interface/resources/qml/hifi/NameCard.qml | 21 ++++++++++----------- interface/resources/qml/hifi/Pal.qml | 6 +++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/interface/resources/qml/hifi/NameCard.qml b/interface/resources/qml/hifi/NameCard.qml index aa908c0039..88ecededd1 100644 --- a/interface/resources/qml/hifi/NameCard.qml +++ b/interface/resources/qml/hifi/NameCard.qml @@ -91,7 +91,7 @@ Item { enabled: selected || isMyCard; hoverEnabled: enabled onClicked: { - userInfoViewer.url = "http://highfidelity.com/users/" + (pal.activeTab == "nearbyTab" ? userName : displayName); // Connections tab puts username in "displayname" field + userInfoViewer.url = "http://highfidelity.com/users/" + userName; userInfoViewer.visible = true; } } @@ -202,13 +202,12 @@ Item { // DisplayName container for others' cards Item { id: displayNameContainer - visible: !isMyCard + visible: !isMyCard && pal.activeTab !== "connectionsTab" // Size width: parent.width - anchors.leftMargin - avatarImage.width - anchors.leftMargin; height: displayNameTextPixelSize + 4 // Anchors - anchors.top: pal.activeTab == "connectionsTab" ? undefined : avatarImage.top; - anchors.bottom: pal.activeTab == "connectionsTab" ? avatarImage.bottom : undefined; + anchors.top: avatarImage.top; anchors.left: avatarImage.right anchors.leftMargin: avatarImage.visible ? 5 : 0; // DisplayName Text for others' cards @@ -227,8 +226,7 @@ Item { // Text Positioning verticalAlignment: Text.AlignTop // Style - color: (pal.activeTab == "nearbyTab" && (displayNameTextMouseArea.containsMouse || userNameTextMouseArea.containsMouse)) - ? hifi.colors.blueHighlight : (pal.activeTab == "nearbyTab" ? hifi.colors.darkGray : hifi.colors.greenShadow); + color: (displayNameTextMouseArea.containsMouse || userNameTextMouseArea.containsMouse) ? hifi.colors.blueHighlight : hifi.colors.darkGray; MouseArea { id: displayNameTextMouseArea; anchors.fill: parent @@ -297,21 +295,22 @@ Item { // Properties text: thisNameCard.userName elide: Text.ElideRight - visible: thisNameCard.displayName + visible: thisNameCard.userName !== ""; // Size width: parent.width - height: usernameTextPixelSize + 4 + height: pal.activeTab == "nearbyTab" || isMyCard ? usernameTextPixelSize + 4 : displayNameTextPixelSize + 4 // Anchors anchors.top: isMyCard ? myDisplayName.bottom : undefined; - anchors.bottom: isMyCard ? undefined : avatarImage.bottom + anchors.bottom: !isMyCard ? avatarImage.bottom : undefined; anchors.left: avatarImage.right; anchors.leftMargin: avatarImage.visible ? 5 : 0; // Text Size - size: usernameTextPixelSize; + size: pal.activeTab == "nearbyTab" || isMyCard ? usernameTextPixelSize : displayNameTextPixelSize; // Text Positioning verticalAlignment: Text.AlignBottom // Style - color: (pal.activeTab == "nearbyTab" && (displayNameTextMouseArea.containsMouse || userNameTextMouseArea.containsMouse)) ? hifi.colors.blueHighlight : hifi.colors.greenShadow; + color: (pal.activeTab == "nearbyTab" && (displayNameTextMouseArea.containsMouse || userNameTextMouseArea.containsMouse)) + ? hifi.colors.blueHighlight : hifi.colors.greenShadow; MouseArea { id: userNameTextMouseArea; anchors.fill: parent diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 8bd6824246..43e874dc57 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -860,8 +860,8 @@ Rectangle { visible: styleData.role === "userName"; profileUrl: (model && model.profileUrl) || ""; imageMaskColor: rowColor(styleData.selected, styleData.row % 2); - displayName: model ? model.userName : ""; - userName: ""; + displayName: ""; + userName: model ? model.userName : ""; connectionStatus : model ? model.connection : ""; selected: styleData.selected; // Size @@ -1001,7 +1001,7 @@ Rectangle { verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter; // Style - color: closeButtonMouseArea.containsMouse ? hifi.colors.lightGray : hifi.colors.darkGray; + color: closeButtonMouseArea.containsMouse ? hifi.colors.redAccent : hifi.colors.redHighlight; MouseArea { id: closeButtonMouseArea; anchors.fill: parent