Add Attributions to Qml Marketplace

This commit is contained in:
Roxanne Skelly 2019-02-04 13:29:06 -08:00
parent 39ad36a4d0
commit 1840f874ab
2 changed files with 111 additions and 13 deletions

View file

@ -369,7 +369,7 @@ Rectangle {
categoriesButton.color = hifi.colors.white;
}
}
Rectangle {
anchors {
left: parent.left;
@ -1057,7 +1057,9 @@ Rectangle {
width: 100
onClicked: {
getMarketplaceItems();
marketplaceItemView.visible = false;
itemsList.visible = true;
licenseInfo.visible = false;
}
}

View file

@ -50,7 +50,15 @@ Rectangle {
categoriesListModel.append({"category":category});
});
}
onAttributionsChanged: {
attributionsModel.clear();
root.attributions.forEach(function(attribution) {
console.log("ATTRIBUITION:" + JSON.stringify(attribution));
attributionsModel.append(attribution);
});
}
onDescriptionChanged: {
descriptionTextModel.clear();
descriptionTextModel.append({text: description})
@ -339,24 +347,112 @@ Rectangle {
}
Rectangle {
anchors {
top: posted.bottom;
leftMargin: 15;
topMargin: 15;
}
width: parent.width;
height: 1;
color: hifi.colors.lightGray;
anchors {
top: posted.bottom
leftMargin: 15
topMargin: 15
}
width: parent.width
height: 1
color: hifi.colors.lightGrayText
}
Item {
id: attributions
anchors {
top: posted.bottom
topMargin: 30
left: parent.left
right: parent.right
}
width: parent.width
height: attributionsModel.count > 0 ? childrenRect.height : 0
visible: attributionsModel.count > 0
RalewaySemiBold {
id: attributionsLabel
anchors.top: parent.top
anchors.left: parent.left
width: paintedWidth
text: "ATTRIBUTIONS:"
size: 14
color: hifi.colors.lightGrayText
verticalAlignment: Text.AlignVCenter
}
ListModel {
id: attributionsModel
}
ListView {
anchors {
left: parent.left
right: parent.right
top: attributionsLabel.bottom
bottomMargin: 15
}
height: 24*model.count+10
model: attributionsModel
delegate: Item {
RalewaySemiBold {
id: attributionName
anchors.leftMargin: 15
width: paintedWidth
text: model.name
size: 14
height: 24
color: hifi.colors.baseGray
verticalAlignment: Text.AlignVCenter
}
RalewaySemiBold {
id: attributionLink
anchors.leftMargin: 15
anchors.left: attributionName.right
width: paintedWidth
text: "Link"
size: 14
height: 24
color: hifi.colors.blueHighlight
verticalAlignment: Text.AlignVCenter
MouseArea {
anchors.fill: attributionLink
onClicked: sendToScript({method: 'marketplace_open_link', link: model.link});
}
}
}
}
Rectangle {
anchors {
bottom: attributions.bottom
leftMargin: 15
}
width: parent.width
height: 1
color: hifi.colors.lightGrayText
}
}
Item {
id: licenseItem;
anchors {
top: posted.bottom
top: attributions.bottom
left: parent.left
topMargin: 30
topMargin: 15
}
width: parent.width
height: childrenRect.height