Attempted Stale PAL fix - hard to test!

This commit is contained in:
Zach Fox 2017-03-22 15:04:44 -07:00
parent 675612c1e9
commit 692ef369c7
2 changed files with 13 additions and 11 deletions

View file

@ -578,7 +578,7 @@ Rectangle {
rowDelegate: Rectangle { // The only way I know to specify a row height. rowDelegate: Rectangle { // The only way I know to specify a row height.
// Size // Size
height: rowHeight + (styleData.selected ? 15 : 0); height: rowHeight + (styleData.selected ? 15 : 0);
color: rowColor(styleData.selected, styleData.alternate, true); color: rowColor(styleData.selected, styleData.alternate);
} }
// This Item refers to the contents of each Cell // This Item refers to the contents of each Cell
@ -595,7 +595,7 @@ Rectangle {
id: nameCard; id: nameCard;
// Properties // Properties
profileUrl: (model && model.profileUrl) || ""; profileUrl: (model && model.profileUrl) || "";
imageMaskColor: rowColor(styleData.selected, styleData.row % 2, model ? model.isPresent : false); imageMaskColor: rowColor(styleData.selected, styleData.row % 2);
displayName: styleData.value; displayName: styleData.value;
userName: model ? model.userName : ""; userName: model ? model.userName : "";
connectionStatus: model ? model.connection : ""; connectionStatus: model ? model.connection : "";
@ -903,7 +903,7 @@ Rectangle {
rowDelegate: Rectangle { rowDelegate: Rectangle {
// Size // Size
height: rowHeight; height: rowHeight;
color: rowColor(styleData.selected, styleData.alternate, true); color: rowColor(styleData.selected, styleData.alternate);
} }
// This Item refers to the contents of each Cell // This Item refers to the contents of each Cell
@ -916,7 +916,7 @@ Rectangle {
// Properties // Properties
visible: styleData.role === "userName"; visible: styleData.role === "userName";
profileUrl: (model && model.profileUrl) || ""; profileUrl: (model && model.profileUrl) || "";
imageMaskColor: rowColor(styleData.selected, styleData.row % 2, true); imageMaskColor: rowColor(styleData.selected, styleData.row % 2);
displayName: ""; displayName: "";
userName: model ? model.userName : ""; userName: model ? model.userName : "";
connectionStatus : model ? model.connection : ""; connectionStatus : model ? model.connection : "";
@ -1159,8 +1159,8 @@ Rectangle {
} }
} }
function rowColor(selected, alternate, isPresent) { function rowColor(selected, alternate) {
return isPresent ? (selected ? hifi.colors.orangeHighlight : alternate ? hifi.colors.tableRowLightEven : hifi.colors.tableRowLightOdd) : hifi.colors.gray; return selected ? hifi.colors.orangeHighlight : alternate ? hifi.colors.tableRowLightEven : hifi.colors.tableRowLightOdd;
} }
function findNearbySessionIndex(sessionId, optionalData) { // no findIndex in .qml function findNearbySessionIndex(sessionId, optionalData) { // no findIndex in .qml
var data = optionalData || nearbyUserModelData, length = data.length; var data = optionalData || nearbyUserModelData, length = data.length;
@ -1291,9 +1291,11 @@ Rectangle {
var userIndex = findNearbySessionIndex(sessionID); var userIndex = findNearbySessionIndex(sessionID);
if (userIndex != -1) { if (userIndex != -1) {
if (!nearbyUserModelData[userIndex].ignore) { if (!nearbyUserModelData[userIndex].ignore) {
nearbyUserModel.setProperty(userIndex, "isPresent", false); if (reason !== 'avatarAdded') {
nearbyUserModelData[userIndex].isPresent = false; nearbyUserModel.setProperty(userIndex, "isPresent", false);
nearbyTable.selection.deselect(userIndex); nearbyUserModelData[userIndex].isPresent = false;
nearbyTable.selection.deselect(userIndex);
}
reloadNearby.color = 2; reloadNearby.color = 2;
} }
} else { } else {

View file

@ -849,7 +849,7 @@ function clearLocalQMLDataAndClosePAL() {
sendToQml({ method: 'clearLocalQMLData' }); sendToQml({ method: 'clearLocalQMLData' });
} }
function avatarAdded() { function avatarAdded(avatarID) {
sendToQml({ method: 'palIsStale', params: [avatarID, 'avatarAdded'] }); sendToQml({ method: 'palIsStale', params: [avatarID, 'avatarAdded'] });
} }
@ -857,7 +857,7 @@ function avatarRemoved(avatarID) {
sendToQml({ method: 'palIsStale', params: [avatarID, 'avatarRemoved'] }); sendToQml({ method: 'palIsStale', params: [avatarID, 'avatarRemoved'] });
} }
function avatarSessionChanged() { function avatarSessionChanged(avatarID) {
sendToQml({ method: 'palIsStale', params: [avatarID, 'avatarSessionChanged'] }); sendToQml({ method: 'palIsStale', params: [avatarID, 'avatarSessionChanged'] });
} }