mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge pull request #10152 from howard-stearns/fix-sort-by-connections-friend-column
fix sorting by pal connections-tab friends column
This commit is contained in:
commit
a1c211395b
1 changed files with 6 additions and 6 deletions
|
@ -756,7 +756,7 @@ Rectangle {
|
||||||
resizable: false;
|
resizable: false;
|
||||||
}
|
}
|
||||||
TableViewColumn {
|
TableViewColumn {
|
||||||
role: "friends";
|
role: "connection";
|
||||||
title: "FRIEND";
|
title: "FRIEND";
|
||||||
width: actionButtonWidth;
|
width: actionButtonWidth;
|
||||||
movable: false;
|
movable: false;
|
||||||
|
@ -834,16 +834,16 @@ Rectangle {
|
||||||
// "Friends" checkbox
|
// "Friends" checkbox
|
||||||
HifiControlsUit.CheckBox {
|
HifiControlsUit.CheckBox {
|
||||||
id: friendsCheckBox;
|
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:
|
// you would think that this would work:
|
||||||
// anchors.verticalCenter: connectionsNameCard.avImage.verticalCenter
|
// anchors.verticalCenter: connectionsNameCard.avImage.verticalCenter
|
||||||
// but no! you cannot anchor to a non-sibling or parent. So:
|
// but no! you cannot anchor to a non-sibling or parent. So:
|
||||||
x: parent.width/2 - boxSize/2
|
x: parent.width/2 - boxSize/2;
|
||||||
y: connectionsNameCard.avImage.y + connectionsNameCard.avImage.height/2 - boxSize/2
|
y: connectionsNameCard.avImage.y + connectionsNameCard.avImage.height/2 - boxSize/2;
|
||||||
checked: model ? (model["connection"] === "friend" ? true : false) : false;
|
checked: model && (model.connection === "friend");
|
||||||
boxSize: 24;
|
boxSize: 24;
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var newValue = !(model["connection"] === "friend");
|
var newValue = model.connection !== "friend";
|
||||||
connectionsUserModel.setProperty(model.userIndex, styleData.role, newValue);
|
connectionsUserModel.setProperty(model.userIndex, styleData.role, newValue);
|
||||||
connectionsUserModelData[model.userIndex][styleData.role] = newValue; // Defensive programming
|
connectionsUserModelData[model.userIndex][styleData.role] = newValue; // Defensive programming
|
||||||
pal.sendToScript({method: newValue ? 'addFriend' : 'removeFriend', params: model.userName});
|
pal.sendToScript({method: newValue ? 'addFriend' : 'removeFriend', params: model.userName});
|
||||||
|
|
Loading…
Reference in a new issue