Skip to content

Commit

Permalink
fix(Profile): Added menu to remove profile image
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-sirotin committed Aug 7, 2022
1 parent c6c76a1 commit febad28
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 446 deletions.
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

0 comments on commit febad28

Please sign in to comment.