mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Set avatar button on proper position
This commit is contained in:
parent
875b625abb
commit
3fecbe02a3
@ -31,8 +31,14 @@ Item
|
||||
|
||||
Button
|
||||
{
|
||||
text: "Open f d "
|
||||
id: avatarPicker
|
||||
|
||||
text: "Change your Avatar"
|
||||
visible: isOwn
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
onClicked:
|
||||
{
|
||||
fileChooser.open()
|
||||
@ -43,27 +49,17 @@ Item
|
||||
onResultFileChanged:
|
||||
{
|
||||
console.log("Result file changed! " , resultFile)
|
||||
newAvatar.source = resultFile
|
||||
|
||||
var base64Image = androidImagePicker.imageToBase64(resultFile)
|
||||
|
||||
rsApi.request("/identity/set_avatar", JSON.stringify({"gxs_id": cntDt.md.gxs_id, "avatar": base64Image }),
|
||||
function (res){
|
||||
console.log("Avatar changed! " , JSON.stringify(res))
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image
|
||||
{
|
||||
id: newAvatar
|
||||
height: topFace.height
|
||||
width: topFace.height
|
||||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
}
|
||||
|
||||
AvatarOrColorHash
|
||||
{
|
||||
@ -71,7 +67,7 @@ Item
|
||||
|
||||
gxs_id: cntDt.md.gxs_id
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.top: (isOwn)? avatarPicker.bottom : parent.top
|
||||
anchors.topMargin: 6
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user