Add section back.

Enable pixelAligned for flickable.
Tweak timeline delegate.
This commit is contained in:
Black Hat
2019-05-11 20:53:33 +08:00
parent 627647207b
commit 49545df607
12 changed files with 205 additions and 88 deletions

View File

@@ -201,6 +201,8 @@ Item {
background: Rectangle {
color: Material.background
opacity: listView.atYBeginning ? 0 : 1
layer.enabled: true
layer.effect: ElevationEffect {
elevation: 2

View File

@@ -155,8 +155,6 @@ Item {
roleValue: "state"
delegate: StateDelegate {
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(implicitWidth, parent.width)
}
}
@@ -164,49 +162,78 @@ Item {
roleValue: "emote"
delegate: StateDelegate {
anchors.horizontalCenter: parent.horizontalCenter
width: Math.min(implicitWidth, parent.width)
}
}
DelegateChoice {
roleValue: "message"
delegate: MessageDelegate {
anchors.right: sentByMe ? parent.right : undefined
delegate: ColumnLayout {
width: messageListView.width
SectionDelegate {
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: parent.width
visible: showSection
}
MessageDelegate {
Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
}
}
}
DelegateChoice {
roleValue: "notice"
delegate: MessageDelegate {
anchors.right: sentByMe ? parent.right : undefined
delegate: ColumnLayout {
width: messageListView.width
SectionDelegate {
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: parent.width
visible: showSection
}
MessageDelegate {
Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
}
}
}
DelegateChoice {
roleValue: "image"
delegate: ImageDelegate {
anchors.right: sentByMe ? parent.right : undefined
delegate: ColumnLayout {
width: messageListView.width
Layout.maximumWidth: parent.width
}
}
SectionDelegate {
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: parent.width
DelegateChoice {
roleValue: "sticker"
delegate: ImageDelegate {
anchors.right: sentByMe ? parent.right : undefined
visible: showSection
}
Layout.maximumWidth: parent.width
ImageDelegate {
Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
}
}
}
DelegateChoice {
roleValue: "file"
delegate: FileDelegate {
anchors.right: sentByMe ? parent.right : undefined
delegate: ColumnLayout {
width: messageListView.width
Layout.maximumWidth: parent.width
SectionDelegate {
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: parent.width
visible: showSection
}
FileDelegate {
Layout.alignment: sentByMe ? Qt.AlignRight : Qt.AlignLeft
}
}
}