From 2289dbb3fe63cc8271335f2ec319a75bb4e676a0 Mon Sep 17 00:00:00 2001 From: James Graham Date: Sun, 8 Feb 2026 15:48:23 +0000 Subject: [PATCH] Restore placeholder messages --- src/messagecontent/TextComponent.qml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/messagecontent/TextComponent.qml b/src/messagecontent/TextComponent.qml index ec4a01075..bcf49c2b7 100644 --- a/src/messagecontent/TextComponent.qml +++ b/src/messagecontent/TextComponent.qml @@ -13,7 +13,7 @@ import org.kde.neochat /** * @brief A component to show rich text from a message. */ -TextEdit { +QQC2.TextArea { id: root /** @@ -85,8 +85,8 @@ TextEdit { ListView.onReused: Qt.binding(() => !hasSpoiler.test(display)) - leftPadding: Kirigami.Units.smallSpacing - rightPadding: Kirigami.Units.smallSpacing + leftPadding: 0 + rightPadding: 0 text: root.editable ? "" : display @@ -103,6 +103,15 @@ TextEdit { readOnly: !root.editable wrapMode: Text.Wrap textFormat: Text.RichText + placeholderText: if (!editable || index !== (Message.contentModel?.hasAttachment ? 1 : 0)) { + return ""; + } else if (Message.contentModel?.hasAttachment) { + i18nc("@placeholder", "Set an attachment caption…") + } else if (Message.room?.usesEncryption) { + i18nc("@placeholder", "Send an encrypted message…") + } else { + i18nc("@placeholder", "Send a message…") + } onLinkActivated: link => { if (!root.editable) { @@ -140,4 +149,6 @@ TextEdit { RoomManager.viewEventMenu(root.QQC2.Overlay.overlay, event, root.Message.room, root.Message.selectedText, root.Message.hoveredLink); } } + + background: null }