Make attachments list flickable

This commit is contained in:
David Rowe 2017-03-10 08:26:00 +13:00
parent 53dcf80cc0
commit c7d1aa8ff4

View file

@ -40,57 +40,13 @@ Item {
color: hifi.colors.baseGrayShadow
radius: 4
ScrollView {
id: scrollView
anchors.fill: parent
anchors.margins: 4
style: ScrollViewStyle {
padding {
top: 0
right: 0
bottom: 0
}
decrementControl: Item {
visible: false
}
incrementControl: Item {
visible: false
}
scrollBarBackground: Rectangle{
implicitWidth: 14
color: hifi.colors.baseGray
radius: 4
Rectangle {
// Make top left corner of scrollbar appear square
width: 8
height: 4
color: hifi.colors.baseGray
anchors.top: parent.top
anchors.horizontalCenter: parent.left
}
}
handle:
Rectangle {
implicitWidth: 8
anchors {
left: parent.left
leftMargin: 3
top: parent.top
topMargin: 3
bottom: parent.bottom
bottomMargin: 4
}
radius: 4
color: hifi.colors.lightGrayText
}
}
ListView {
id: listView
anchors.fill: parent
anchors.margins: 4
clip: true
focus: true
model: ListModel {}
delegate: Item {
id: attachmentDelegate
@ -98,7 +54,7 @@ Item {
implicitWidth: attachmentView.width
Attachment {
id: attachmentView
width: scrollView.width
width: listView.width
attachment: content.attachments[index]
onDeleteAttachment: {
attachments.splice(index, 1);
@ -108,10 +64,10 @@ Item {
}
}
onCountChanged: MyAvatar.setAttachmentsVariant(attachments);
}
function scrollBy(delta) {
flickableItem.contentY += delta;
// @@@@@@@
//flickableItem.contentY += delta;
}
}
}
@ -191,7 +147,7 @@ Item {
}
function scrollBy(delta) {
scrollView.scrollBy(delta);
listView.scrollBy(delta);
}
}