Display reactions in MessageDelegate.

This commit is contained in:
Black Hat
2019-07-21 16:11:26 +08:00
parent 992cbaca87
commit 761943f98f
6 changed files with 73 additions and 4 deletions

View File

@@ -220,6 +220,12 @@ ColumnLayout {
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
}
}
ReactionDelegate {
Layout.bottomMargin: 8
Layout.leftMargin: 16
Layout.rightMargin: 16
}
}
}
}

View File

@@ -0,0 +1,28 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import Spectral.Setting 0.1
RowLayout {
visible: reaction || false
Repeater {
model: reaction
delegate: Control {
horizontalPadding: 4
verticalPadding: 0
background: Rectangle {
radius: height / 2
color: MPalette.banner
}
contentItem: Label {
text: modelData.reaction + " " + modelData.count
font.pixelSize: 10
}
}
}
}

View File

@@ -5,3 +5,4 @@ SectionDelegate 2.0 SectionDelegate.qml
ImageDelegate 2.0 ImageDelegate.qml
FileDelegate 2.0 FileDelegate.qml
VideoDelegate 2.0 VideoDelegate.qml
ReactionDelegate 2.0 ReactionDelegate.qml