Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Profile): Added menu to remove profile image #6862

Merged
merged 1 commit into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 0 additions & 115 deletions ui/app/AppLayouts/Profile/popups/ChangeProfilePicModal.qml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ ColumnLayout {
Layout.leftMargin: Style.current.padding
Layout.rightMargin: Style.current.padding

store: root.profileStore

displayName: profileStore.name
pubkey: profileStore.pubkey
icon: profileStore.profileLargeImage
Expand Down
213 changes: 0 additions & 213 deletions ui/imports/shared/controls/ImageCropper.qml

This file was deleted.

26 changes: 25 additions & 1 deletion ui/imports/shared/controls/chat/ProfileHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import shared.controls 1.0

import StatusQ.Controls 0.1
import StatusQ.Components 0.1
import StatusQ.Popups 0.1
import StatusQ.Core.Utils 0.1 as StatusQUtils

Item {
Expand Down Expand Up @@ -94,7 +95,12 @@ Item {
icon.width: 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();
}
}
}

Expand Down Expand Up @@ -210,4 +216,22 @@ Item {
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