From 259b9884c737d025f2cf733a5411635803bad9cc Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Tue, 28 Nov 2023 04:07:19 +0300 Subject: [PATCH] Set WrapMode on all TextArea components, and fix up some of the Labels Upstream styles do not provide any wrapping by default, and thus we should not rely on deceptively convenient override in qqc2-desktop-style. See https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/331 --- src/qml/ChatBar.qml | 2 +- src/qml/General.qml | 1 + src/qml/MessageEditComponent.qml | 2 +- src/qml/MessageSourceSheet.qml | 2 +- src/qml/ReplyPane.qml | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qml/ChatBar.qml b/src/qml/ChatBar.qml index 63a295231..43d245238 100644 --- a/src/qml/ChatBar.qml +++ b/src/qml/ChatBar.qml @@ -187,7 +187,7 @@ QQC2.Control { placeholderText: root.currentRoom.usesEncryption ? i18n("Send an encrypted message…") : root.currentRoom.mainCache.attachmentPath.length > 0 ? i18n("Set an attachment caption…") : i18n("Send a message…") verticalAlignment: TextEdit.AlignVCenter - wrapMode: Text.Wrap + wrapMode: TextEdit.Wrap Accessible.description: placeholderText diff --git a/src/qml/General.qml b/src/qml/General.qml index ca783c5c1..a3a106ebe 100644 --- a/src/qml/General.qml +++ b/src/qml/General.qml @@ -86,6 +86,7 @@ FormCard.FormCardPage { id: roomTopicTextArea Accessible.description: roomTopicLabel.text Layout.fillWidth: true + wrapMode: TextEdit.Wrap text: room.topic readOnly: !room.canSendState("m.room.topic") onTextChanged: roomTopicField.text = text diff --git a/src/qml/MessageEditComponent.qml b/src/qml/MessageEditComponent.qml index ce70188c6..5388223f9 100644 --- a/src/qml/MessageEditComponent.qml +++ b/src/qml/MessageEditComponent.qml @@ -34,7 +34,7 @@ QQC2.TextArea { color: Kirigami.Theme.textColor verticalAlignment: TextEdit.AlignVCenter - wrapMode: Text.Wrap + wrapMode: TextEdit.Wrap onTextChanged: { _private.chatBarCache.text = text diff --git a/src/qml/MessageSourceSheet.qml b/src/qml/MessageSourceSheet.qml index b8c730ebe..de2ed777c 100644 --- a/src/qml/MessageSourceSheet.qml +++ b/src/qml/MessageSourceSheet.qml @@ -32,7 +32,7 @@ Kirigami.Page { text: sourceText readOnly: true textFormat: TextEdit.PlainText - wrapMode: Text.WordWrap + wrapMode: TextEdit.Wrap background: Rectangle { Kirigami.Theme.colorSet: Kirigami.Theme.View Kirigami.Theme.inherit: false diff --git a/src/qml/ReplyPane.qml b/src/qml/ReplyPane.qml index 3f39e3f0f..61e97e802 100644 --- a/src/qml/ReplyPane.qml +++ b/src/qml/ReplyPane.qml @@ -63,7 +63,7 @@ RowLayout { selectByMouse: true selectByKeyboard: true readOnly: true - wrapMode: QQC2.Label.Wrap + wrapMode: TextEdit.Wrap textFormat: TextEdit.RichText background: Item {} HoverHandler {