fix(chat): Download/invite popup small issues

- make the popup centered across the whole window
- fix (and extract) the get/download link to `Constants`
- fix some memleaks

Fixes #11926
This commit is contained in:
Lukáš Tinkl 2023-08-18 17:01:49 +02:00 committed by Lukáš Tinkl
parent a210189137
commit 5aec48da35
4 changed files with 11 additions and 9 deletions

View File

@ -81,7 +81,7 @@ Item {
parent.font.underline = false
}
onClicked: {
inviteFriendsPopup.open();
Global.openPopup(inviteFriendsPopup)
}
}
}
@ -95,8 +95,11 @@ Item {
anchors.top: links.bottom
}
InviteFriendsPopup {
Component {
id: inviteFriendsPopup
rootStore: element.rootStore
InviteFriendsPopup {
rootStore: element.rootStore
destroyOnClose: true
}
}
}

View File

@ -4,9 +4,6 @@ import utils 1.0
StatusModal {
id: root
anchors.centerIn: parent
readonly property string getStatusText: qsTr("Get Status at https://status.im")
property var rootStore
@ -14,11 +11,11 @@ StatusModal {
height: 156
StatusDescriptionListItem {
subTitle: root.getStatusText
tooltip.text: qsTr("Copy to clipboard")
subTitle: qsTr("Get Status at %1").arg(Constants.externalStatusLinkWithHttps)
tooltip.text: qsTr("Copied!")
asset.name: "copy"
iconButton.onClicked: {
root.rootStore.copyToClipboard(Constants.statusLinkPrefix)
root.rootStore.copyToClipboard(Constants.downloadLink)
tooltip.visible = !tooltip.visible
}
width: parent.width

View File

@ -41,6 +41,7 @@ Item {
id: inviteFriendsPopup
InviteFriendsPopup {
rootStore: noContactsRect.rootStore
destroyOnClose: true
}
}
}

View File

@ -922,6 +922,7 @@ QtObject {
readonly property string userLinkPrefix: externalStatusLinkWithHttps + '/u/'
readonly property string statusLinkPrefix: 'https://status.im/'
readonly property string statusHelpLinkPrefix: `https://status.app/help/`
readonly property string downloadLink: "https://status.im/get"
readonly property int maxUploadFiles: 5
readonly property double maxUploadFilesizeMB: 10