From 04341f0321800f33e357593298a4ac43e0ca0033 Mon Sep 17 00:00:00 2001 From: Emil Sawicki Date: Mon, 25 Nov 2024 11:40:47 +0100 Subject: [PATCH] feat: Fixes --- .../AppLayouts/Chat/views/ChatColumnView.qml | 1 + .../chat/ChatInputLinksPreviewArea.qml | 4 ++-- .../chat/PaymentRequestMiniCardDelegate.qml | 22 ++++++++++++++----- ui/imports/shared/status/StatusChatInput.qml | 3 +++ .../shared/views/chat/LinksMessageView.qml | 2 +- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml index ff76d33239..f966dfd25b 100644 --- a/ui/app/AppLayouts/Chat/views/ChatColumnView.qml +++ b/ui/app/AppLayouts/Chat/views/ChatColumnView.qml @@ -391,6 +391,7 @@ Item { d.activeChatContentModule.inputAreaModule.setLinkPreviewEnabledForCurrentMessage(false) } onDismissLinkPreview: (index) => d.activeChatContentModule.inputAreaModule.removeLinkPreviewData(index) + onRemovePaymentRequest: (index) => d.activeChatContentModule.inputAreaModule.removePaymentRequestPreviewData(index) } ChatPermissionQualificationPanel { diff --git a/ui/imports/shared/controls/chat/ChatInputLinksPreviewArea.qml b/ui/imports/shared/controls/chat/ChatInputLinksPreviewArea.qml index b287e7e2be..2d452bbb30 100644 --- a/ui/imports/shared/controls/chat/ChatInputLinksPreviewArea.qml +++ b/ui/imports/shared/controls/chat/ChatInputLinksPreviewArea.qml @@ -47,7 +47,7 @@ Control { signal linkReload(string link) signal linkClicked(string link) - signal paymentRequestRemoved(int index) + signal removePaymentRequest(int index) signal enableLinkPreview() signal enableLinkPreviewForThisMessage() @@ -112,7 +112,7 @@ Control { amount: model.amount symbol: model.symbol - onClose: root.paymentRequestRemoved(model.index) + onClose: root.removePaymentRequest(model.index) } } Repeater { diff --git a/ui/imports/shared/controls/chat/PaymentRequestMiniCardDelegate.qml b/ui/imports/shared/controls/chat/PaymentRequestMiniCardDelegate.qml index 15dd28e553..e226e85bf5 100644 --- a/ui/imports/shared/controls/chat/PaymentRequestMiniCardDelegate.qml +++ b/ui/imports/shared/controls/chat/PaymentRequestMiniCardDelegate.qml @@ -71,13 +71,25 @@ CalloutCard { font.pixelSize: Theme.additionalTextSize font.weight: Font.Medium } - StatusBaseText { + RowLayout { Layout.fillWidth: true Layout.fillHeight: true - font.pixelSize: Theme.tertiaryTextFontSize - color: Theme.palette.baseColor1 - verticalAlignment: Text.AlignVCenter - text: "%1 %2".arg(root.amount).arg(root.symbol) + StatusBaseText { + Layout.maximumWidth: parent.width * 0.8 + Layout.fillHeight: true + font.pixelSize: Theme.tertiaryTextFontSize + color: Theme.palette.baseColor1 + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + text: root.amount + } + StatusBaseText { + Layout.fillHeight: true + font.pixelSize: Theme.tertiaryTextFontSize + color: Theme.palette.baseColor1 + verticalAlignment: Text.AlignVCenter + text: root.symbol + } } } diff --git a/ui/imports/shared/status/StatusChatInput.qml b/ui/imports/shared/status/StatusChatInput.qml index 735fbedb23..70b160a061 100644 --- a/ui/imports/shared/status/StatusChatInput.qml +++ b/ui/imports/shared/status/StatusChatInput.qml @@ -37,6 +37,7 @@ Rectangle { signal disableLinkPreview() signal dismissLinkPreviewSettings() signal dismissLinkPreview(int index) + signal removePaymentRequest(int index) property var usersModel property SharedStores.RootStore sharedStore @@ -1224,6 +1225,7 @@ Rectangle { topPadding: 12 imagePreviewArray: control.fileUrlsAndSources linkPreviewModel: control.linkPreviewModel + paymentRequestModel: control.paymentRequestModel showLinkPreviewSettings: control.askToEnableLinkPreview onImageRemoved: (index) => { //Just do a copy and replace the whole thing because it's a plain JS array and thre's no signal when a single item is removed @@ -1242,6 +1244,7 @@ Rectangle { onDisableLinkPreview: () => control.disableLinkPreview() onDismissLinkPreviewSettings: () => control.dismissLinkPreviewSettings() onDismissLinkPreview: (index) => control.dismissLinkPreview(index) + onRemovePaymentRequest: (index) => control.removePaymentRequest(index) } RowLayout { diff --git a/ui/imports/shared/views/chat/LinksMessageView.qml b/ui/imports/shared/views/chat/LinksMessageView.qml index a9dfc79d0e..fbd1590091 100644 --- a/ui/imports/shared/views/chat/LinksMessageView.qml +++ b/ui/imports/shared/views/chat/LinksMessageView.qml @@ -68,7 +68,7 @@ Flow { model: root.paymentRequestModel delegate: PaymentRequestCardDelegate { required property var model - objectName: "RpaymentRequestDelegate_" + model.index + objectName: "PaymentRequestDelegate_" + model.index amount: model.amount symbol: model.symbol address: model.receiver