From 9577102c229f503846d731315d789672ed541f3a Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Thu, 6 Apr 2017 14:45:08 -0700 Subject: [PATCH] fix sorting by pal connections-tab friends column --- interface/resources/qml/hifi/Pal.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index d627fb54f9..9e93ddc8d7 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -756,7 +756,7 @@ Rectangle { resizable: false; } TableViewColumn { - role: "friends"; + role: "connection"; title: "FRIEND"; width: actionButtonWidth; movable: false; @@ -834,16 +834,16 @@ Rectangle { // "Friends" checkbox HifiControlsUit.CheckBox { id: friendsCheckBox; - visible: styleData.role === "friends" && model && model.userName !== myData.userName; + visible: styleData.role === "connection" && model && model.userName !== myData.userName; // you would think that this would work: // anchors.verticalCenter: connectionsNameCard.avImage.verticalCenter // but no! you cannot anchor to a non-sibling or parent. So: - x: parent.width/2 - boxSize/2 - y: connectionsNameCard.avImage.y + connectionsNameCard.avImage.height/2 - boxSize/2 - checked: model ? (model["connection"] === "friend" ? true : false) : false; + x: parent.width/2 - boxSize/2; + y: connectionsNameCard.avImage.y + connectionsNameCard.avImage.height/2 - boxSize/2; + checked: model && (model.connection === "friend"); boxSize: 24; onClicked: { - var newValue = !(model["connection"] === "friend"); + var newValue = model.connection !== "friend"; connectionsUserModel.setProperty(model.userIndex, styleData.role, newValue); connectionsUserModelData[model.userIndex][styleData.role] = newValue; // Defensive programming pal.sendToScript({method: newValue ? 'addFriend' : 'removeFriend', params: model.userName});