Display reactions in MessageDelegate.
This commit is contained in:
@@ -220,6 +220,12 @@ ColumnLayout {
|
||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
}
|
||||
}
|
||||
|
||||
ReactionDelegate {
|
||||
Layout.bottomMargin: 8
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
imports/Spectral/Component/Timeline/ReactionDelegate.qml
Normal file
28
imports/Spectral/Component/Timeline/ReactionDelegate.qml
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user