fix(Profile): Added menu to remove profile image
This commit is contained in:
parent
980135fedf
commit
5c909cae6c
|
@ -68,6 +68,8 @@ ColumnLayout {
|
||||||
Layout.leftMargin: Style.current.padding
|
Layout.leftMargin: Style.current.padding
|
||||||
Layout.rightMargin: Style.current.padding
|
Layout.rightMargin: Style.current.padding
|
||||||
|
|
||||||
|
store: root.profileStore
|
||||||
|
|
||||||
displayName: profileStore.name
|
displayName: profileStore.name
|
||||||
pubkey: profileStore.pubkey
|
pubkey: profileStore.pubkey
|
||||||
icon: profileStore.profileLargeImage
|
icon: profileStore.profileLargeImage
|
||||||
|
|
|
@ -7,6 +7,7 @@ import shared.controls 1.0
|
||||||
|
|
||||||
import StatusQ.Controls 0.1
|
import StatusQ.Controls 0.1
|
||||||
import StatusQ.Components 0.1
|
import StatusQ.Components 0.1
|
||||||
|
import StatusQ.Popups 0.1
|
||||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
@ -95,7 +96,12 @@ Item {
|
||||||
icon.width: d.getSize(8, 12, 20)
|
icon.width: d.getSize(8, 12, 20)
|
||||||
icon.height: d.getSize(8, 12, 20)
|
icon.height: d.getSize(8, 12, 20)
|
||||||
|
|
||||||
onClicked: Global.openChangeProfilePicPopup()
|
onClicked: {
|
||||||
|
if (!!root.store.profileLargeImage)
|
||||||
|
imageEditMenu.popup(this, mouse.x, mouse.y);
|
||||||
|
else
|
||||||
|
Global.openChangeProfilePicPopup();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,4 +219,22 @@ Item {
|
||||||
publicKey: root.pubkey
|
publicKey: root.pubkey
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StatusPopupMenu {
|
||||||
|
id: imageEditMenu
|
||||||
|
|
||||||
|
StatusMenuItem {
|
||||||
|
text: qsTr("Upload a file")
|
||||||
|
icon.name: "download"
|
||||||
|
iconRotation: 180
|
||||||
|
onTriggered: Global.openChangeProfilePicPopup()
|
||||||
|
}
|
||||||
|
|
||||||
|
StatusMenuItem {
|
||||||
|
text: qsTr("Remove image")
|
||||||
|
type: StatusMenuItem.Danger
|
||||||
|
icon.name: "delete"
|
||||||
|
onTriggered: root.store.removeImage()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue