mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Make attachments list flickable
This commit is contained in:
parent
53dcf80cc0
commit
c7d1aa8ff4
1 changed files with 21 additions and 65 deletions
|
@ -40,78 +40,34 @@ Item {
|
||||||
color: hifi.colors.baseGrayShadow
|
color: hifi.colors.baseGrayShadow
|
||||||
radius: 4
|
radius: 4
|
||||||
|
|
||||||
ScrollView {
|
ListView {
|
||||||
id: scrollView
|
id: listView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 4
|
anchors.margins: 4
|
||||||
|
clip: true
|
||||||
|
focus: true
|
||||||
|
|
||||||
style: ScrollViewStyle {
|
model: ListModel {}
|
||||||
|
delegate: Item {
|
||||||
padding {
|
id: attachmentDelegate
|
||||||
top: 0
|
implicitHeight: attachmentView.height + 8;
|
||||||
right: 0
|
implicitWidth: attachmentView.width
|
||||||
bottom: 0
|
Attachment {
|
||||||
}
|
id: attachmentView
|
||||||
|
width: listView.width
|
||||||
decrementControl: Item {
|
attachment: content.attachments[index]
|
||||||
visible: false
|
onDeleteAttachment: {
|
||||||
}
|
attachments.splice(index, 1);
|
||||||
incrementControl: Item {
|
listView.model.remove(index, 1);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
onUpdateAttachment: MyAvatar.setAttachmentsVariant(attachments);
|
||||||
}
|
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
onCountChanged: MyAvatar.setAttachmentsVariant(attachments);
|
||||||
ListView {
|
|
||||||
id: listView
|
|
||||||
model: ListModel {}
|
|
||||||
delegate: Item {
|
|
||||||
id: attachmentDelegate
|
|
||||||
implicitHeight: attachmentView.height + 8;
|
|
||||||
implicitWidth: attachmentView.width
|
|
||||||
Attachment {
|
|
||||||
id: attachmentView
|
|
||||||
width: scrollView.width
|
|
||||||
attachment: content.attachments[index]
|
|
||||||
onDeleteAttachment: {
|
|
||||||
attachments.splice(index, 1);
|
|
||||||
listView.model.remove(index, 1);
|
|
||||||
}
|
|
||||||
onUpdateAttachment: MyAvatar.setAttachmentsVariant(attachments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onCountChanged: MyAvatar.setAttachmentsVariant(attachments);
|
|
||||||
}
|
|
||||||
|
|
||||||
function scrollBy(delta) {
|
function scrollBy(delta) {
|
||||||
flickableItem.contentY += delta;
|
// @@@@@@@
|
||||||
|
//flickableItem.contentY += delta;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,7 +147,7 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function scrollBy(delta) {
|
function scrollBy(delta) {
|
||||||
scrollView.scrollBy(delta);
|
listView.scrollBy(delta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue