fix(desktop/profile): Exposing cropping parameters to InsertDetailsView

Fix #5238
This commit is contained in:
Michal Iskierko 2022-04-08 11:49:32 +02:00 committed by Iuri Matias
parent f067d59612
commit 4b6c113b85
2 changed files with 8 additions and 5 deletions

View File

@ -12,18 +12,20 @@ import shared.popups 1.0
StatusModal { StatusModal {
id: popup id: popup
height: 510 height: 510
header.title: qsTr("Upload profile picture") header.title: qsTr("Upload profile picture")
readonly property alias aX: cropImageModal.aX
readonly property alias aY: cropImageModal.aY
readonly property alias bX: cropImageModal.bX
readonly property alias bY: cropImageModal.bY
property string selectedImage property string selectedImage
property string uploadError property string uploadError
signal accepted() signal accepted()
onOpened: {
selectedImage = ""
}
contentItem: Item { contentItem: Item {
anchors.fill: parent anchors.fill: parent
RoundedImage { RoundedImage {

View File

@ -92,6 +92,7 @@ Item {
type: StatusFlatRoundButton.Type.Secondary type: StatusFlatRoundButton.Type.Secondary
icon.name: "add" icon.name: "add"
onClicked: { onClicked: {
uploadProfilePicPopup.selectedImage = userImage.image.source
uploadProfilePicPopup.open(); uploadProfilePicPopup.open();
} }
} }
@ -180,7 +181,7 @@ Item {
id: uploadProfilePicPopup id: uploadProfilePicPopup
anchors.centerIn: parent anchors.centerIn: parent
onAccepted: { onAccepted: {
userImage.image.source = uploadProfilePicPopup.selectedImage userImage.image.source = selectedImage
OnboardingStore.uploadImage(selectedImage, aX, aY, bX, bY); OnboardingStore.uploadImage(selectedImage, aX, aY, bX, bY);
} }
} }