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 spacing: 8
Repeater {
model: userMarker
ImageItem {
width: parent.height
height: parent.height
hint: modelData.displayName
defaultColor: Util.stringToColor(modelData.displayName)
image: modelData.avatar
}
}
AutoLabel { AutoLabel {
id: timeLabel id: timeLabel
@ -107,24 +120,6 @@ RowLayout {
Material.foreground: "grey" Material.foreground: "grey"
font.pointSize: 8 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 spacing: 8
boundsBehavior: Flickable.DragOverBounds boundsBehavior: Flickable.DragOverBounds
flickDeceleration: 9001 flickDeceleration: 2000
cacheBuffer: 200 cacheBuffer: 200
@ -277,6 +277,7 @@ Item {
id: readMarkerListView id: readMarkerListView
clip: true clip: true
boundsBehavior: Flickable.DragOverBounds
delegate: ItemDelegate { delegate: ItemDelegate {
width: parent.width width: parent.width
@ -303,6 +304,8 @@ Item {
} }
} }
} }
ScrollBar.vertical: ScrollBar {}
} }
} }
} }

View File

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

View File

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