diff --git a/TODO.md b/TODO.md index 4ae7225b..f122999b 100644 --- a/TODO.md +++ b/TODO.md @@ -36,8 +36,6 @@ - UI - Show error if uploading avatar fails or file is corrupted - Way to open context menus without a right mouse button - - Room header descriptions: support URLs - - Also support URLs for "room topic changed" event messages - Indeterminate progress bar - Message selection diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index d59cb67f..936e586b 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -459,7 +459,7 @@ class MatrixClient(nio.AsyncClient): room_id = room.room_id, display_name = room.display_name, avatar_url = room.gen_avatar_url or "", - topic = room.topic or "", + topic = HTML_FILTER.filter_inline(room.topic or ""), inviter_id = inviter, inviter_name = room.user_name(inviter) if inviter else "", inviter_avatar = @@ -780,7 +780,8 @@ class MatrixClient(nio.AsyncClient): async def onRoomTopicEvent(self, room, ev) -> None: - co = f"%1 changed the room's topic to \"{ev.topic}\"." + topic = HTML_FILTER.filter_inline(ev.topic) + co = f"%1 changed the room's topic to \"{topic}\"." await self.register_nio_event(room, ev, content=co) diff --git a/src/qml/Base/HToolTip.qml b/src/qml/Base/HToolTip.qml index 6e74c5e1..212a8b40 100644 --- a/src/qml/Base/HToolTip.qml +++ b/src/qml/Base/HToolTip.qml @@ -7,7 +7,7 @@ ToolTip { padding: background.border.width contentWidth: Math.min( mainUI.width / 1.25, - contentItem.implicitWidth, + // contentItem.implicitWidth, theme.fontSize.normal * 0.5 * 75, ) diff --git a/src/qml/Chat/RoomHeader.qml b/src/qml/Chat/RoomHeader.qml index e4353777..8ff9760d 100644 --- a/src/qml/Chat/RoomHeader.qml +++ b/src/qml/Chat/RoomHeader.qml @@ -47,9 +47,10 @@ Rectangle { HoverHandler { id: nameHover } } - HLabel { + HRichLabel { id: roomTopic text: chatPage.roomInfo.topic + textFormat: Text.StyledText font.pixelSize: theme.fontSize.small color: theme.chat.roomHeader.topic elide: Text.ElideRight