Show read receipts inline.

This commit is contained in:
Black Hat 2018-09-15 21:09:53 +08:00
parent 48e614164a
commit 03a8eae491
4 changed files with 28 additions and 20 deletions

View File

@ -98,6 +98,19 @@ RowLayout {
spacing: 8
Repeater {
model: userMarker
ImageItem {
width: parent.height
height: parent.height
hint: modelData.displayName
defaultColor: Util.stringToColor(modelData.displayName)
image: modelData.avatar
}
}
AutoLabel {
id: timeLabel
@ -107,24 +120,6 @@ RowLayout {
Material.foreground: "grey"
font.pointSize: 8
}
MaterialIcon {
height: timeLabel.height
visible: userMarker.length > 0
icon: "\ue5ca"
color: highlighted ? "white": Material.foreground
font.pointSize: 12
MouseArea {
anchors.fill: parent
onClicked: {
readMarkerDialog.listModel = userMarker
readMarkerDialog.open()
}
}
}
}
}

View File

@ -121,7 +121,7 @@ Item {
spacing: 8
boundsBehavior: Flickable.DragOverBounds
flickDeceleration: 9001
flickDeceleration: 2000
cacheBuffer: 200
@ -277,6 +277,7 @@ Item {
id: readMarkerListView
clip: true
boundsBehavior: Flickable.DragOverBounds
delegate: ItemDelegate {
width: parent.width
@ -303,6 +304,8 @@ Item {
}
}
}
ScrollBar.vertical: ScrollBar {}
}
}
}

View File

@ -22,6 +22,16 @@ Menu {
sourceDialog.open()
}
}
MenuItem {
visible: model && model.userMarker.length > 0
height: visible ? undefined : 0
text: "View Receipts"
onTriggered: {
readMarkerDialog.listModel = model.userMarker
readMarkerDialog.open()
}
}
MenuItem {
visible: isFile
height: visible ? undefined : 0

View File

@ -22,7 +22,7 @@ void ImageItem::paint(QPainter *painter) {
int(bounding_rect.height()));
painter->setPen(QPen(Qt::white, 2));
QFont font;
font.setPixelSize(22);
font.setPixelSize(bounding_rect.width() / 2);
font.setBold(true);
painter->setFont(font);
painter->drawText(