feat: Fixes

This commit is contained in:
Emil Sawicki 2024-11-25 11:40:47 +01:00
parent d1ccce5d4d
commit 04341f0321
5 changed files with 24 additions and 8 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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
}
}
}

View File

@ -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 {

View File

@ -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