fix(SetProfilePicture): title was empty on second opening

Closes #5237
This commit is contained in:
Alexandra Betouni 2022-04-07 23:07:52 +03:00 committed by Iuri Matias
parent 8ece8e9fd1
commit 1a8dfde1b2
2 changed files with 9 additions and 13 deletions

View File

@ -4,6 +4,7 @@ import QtQuick.Dialogs 1.3
import utils 1.0 import utils 1.0
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
import shared 1.0 import shared 1.0
import shared.panels 1.0 import shared.panels 1.0
@ -11,10 +12,11 @@ import shared.popups 1.0
import "../stores" import "../stores"
// TODO: replace with StatusModal StatusModal {
ModalPopup {
id: popup id: popup
title: qsTr("Upload profile picture") height: 510
header.title: qsTr("Upload profile picture")
property string selectedImage property string selectedImage
property string uploadError property string uploadError
@ -25,9 +27,8 @@ ModalPopup {
cropImageModal.open(); cropImageModal.open();
} }
Item { contentItem: Item {
anchors.fill: parent anchors.fill: parent
RoundedImage { RoundedImage {
id: profilePic id: profilePic
source: selectedImage source: selectedImage
@ -64,15 +65,10 @@ ModalPopup {
} }
} }
footer: Item { rightButtons: [
width: parent.width
height: uploadBtn.height
StatusButton { StatusButton {
id: uploadBtn id: uploadBtn
text: !!selectedImage ? qsTr("Done") : qsTr("Upload") text: !!selectedImage ? qsTr("Done") : qsTr("Upload")
anchors.right: parent.right
anchors.bottom: parent.bottom
onClicked: { onClicked: {
if (!!selectedImage) { if (!!selectedImage) {
close(); close();
@ -80,7 +76,6 @@ ModalPopup {
imageDialog.open(); imageDialog.open();
} }
} }
FileDialog { FileDialog {
id: imageDialog id: imageDialog
title: qsTrId("please-choose-an-image") title: qsTrId("please-choose-an-image")
@ -93,6 +88,6 @@ ModalPopup {
} }
} }
} }
} ]
} }

View File

@ -178,6 +178,7 @@ Item {
UploadProfilePicModal { UploadProfilePicModal {
id: uploadProfilePicPopup id: uploadProfilePicPopup
anchors.centerIn: parent
} }
} }