ui: limit length of member names in chat view (#4122)

This commit is contained in:
spaced4ndy
2024-05-03 12:34:15 +01:00
committed by GitHub
parent c4cbf751b9
commit 15a226cfd1
4 changed files with 9 additions and 3 deletions
@@ -248,7 +248,10 @@ struct FramedItemView: View {
Group {
if let sender = qi.getSender(membership()) {
VStack(alignment: .leading, spacing: 2) {
Text(sender).font(.caption).foregroundColor(.secondary)
Text(sender)
.font(.caption)
.foregroundColor(.secondary)
.lineLimit(1)
ciQuotedMsgTextView(qi, lines: 2)
}
} else {
@@ -593,6 +593,7 @@ struct ChatView: View {
Text(memberNames(member, prevMember, memCount))
.font(.caption)
.foregroundStyle(.secondary)
.lineLimit(2)
.padding(.leading, memberImageSize + 14)
.padding(.top, 7)
}
@@ -1003,7 +1003,8 @@ fun BoxWithConstraintsScope.ChatItemsList(
Text(
memberNames(member, prevMember, memCount),
Modifier.padding(start = MEMBER_IMAGE_SIZE + 10.dp),
style = TextStyle(fontSize = 13.5.sp, color = CurrentColors.value.colors.secondary)
style = TextStyle(fontSize = 13.5.sp, color = CurrentColors.value.colors.secondary),
maxLines = 2
)
}
Row(
@@ -76,7 +76,8 @@ fun FramedItemView(
) {
Text(
sender,
style = TextStyle(fontSize = 13.5.sp, color = CurrentColors.value.colors.secondary)
style = TextStyle(fontSize = 13.5.sp, color = CurrentColors.value.colors.secondary),
maxLines = 1
)
ciQuotedMsgTextView(qi, lines = 2)
}