Improve location marker

Change location marker to GPS icon, make sure the point is the anchor and colour it with highlight colour

m.self \
![image](/uploads/d7136e7f70a106665fcaea0588a334f7/image.png)

m.pin \
![image](/uploads/baee5d19c098eaab1abd91533fe431e5/image.png)
This commit is contained in:
James Graham
2023-03-27 16:38:34 +00:00
parent d0b1610a9f
commit b1b6c7ceed
4 changed files with 37 additions and 3 deletions

View File

@@ -71,6 +71,7 @@ QHash<int, QByteArray> MessageEventModel::roleNames() const
roles[IsPendingRole] = "isPending";
roles[LatitudeRole] = "latitude";
roles[LongitudeRole] = "longitude";
roles[AssetRole] = "asset";
return roles;
}
@@ -835,6 +836,14 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
return latitude.toFloat();
}
if (role == AssetRole) {
const auto assetType = evt.contentJson()["org.matrix.msc3488.asset"].toObject()["type"].toString();
if (assetType.isEmpty()) {
return {};
}
return assetType;
}
if (role == ReadMarkersRole) {
#ifdef QUOTIENT_07
auto userIds = room()->userIdsAtEvent(evt.id());