2024-10-15 08:13:36 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2022-03-09 10:27:32 +00:00
|
|
|
import shared.controls.chat 1.0
|
2024-02-14 12:52:54 +00:00
|
|
|
import shared.controls.chat.menuItems 1.0
|
2024-10-15 08:13:36 +00:00
|
|
|
import shared.panels 1.0
|
|
|
|
import utils 1.0
|
2024-05-22 08:13:39 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusMenu {
|
2021-08-05 18:06:19 +00:00
|
|
|
id: root
|
2022-03-09 10:27:32 +00:00
|
|
|
|
2024-10-22 12:39:42 +00:00
|
|
|
property alias pubKey: header.pubkey
|
|
|
|
property alias emojiHash: header.emojiHash
|
2024-10-15 08:13:36 +00:00
|
|
|
property alias name: header.displayName
|
|
|
|
property alias icon: header.icon
|
|
|
|
|
|
|
|
property alias isEnsVerified: header.userIsEnsVerified
|
|
|
|
|
|
|
|
// Constants.currentUserStatus
|
|
|
|
property int currentUserStatus
|
|
|
|
|
|
|
|
signal viewProfileRequested
|
|
|
|
signal copyLinkRequested
|
|
|
|
signal setCurrentUserStatusRequested(int status)
|
2022-03-09 10:27:32 +00:00
|
|
|
|
|
|
|
ProfileHeader {
|
2024-10-15 08:13:36 +00:00
|
|
|
id: header
|
2022-03-09 10:27:32 +00:00
|
|
|
|
2023-12-21 17:10:26 +00:00
|
|
|
objectName: 'onlineIdentifierProfileHeader'
|
2022-03-09 10:27:32 +00:00
|
|
|
|
2024-10-15 08:13:36 +00:00
|
|
|
width: parent.width
|
2022-03-09 10:27:32 +00:00
|
|
|
}
|
2021-08-05 18:06:19 +00:00
|
|
|
|
2024-10-15 08:13:36 +00:00
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
2024-02-14 12:52:54 +00:00
|
|
|
ViewProfileMenuItem {
|
2022-08-18 07:38:47 +00:00
|
|
|
objectName: "userStatusViewMyProfileAction"
|
2022-03-09 10:27:32 +00:00
|
|
|
onTriggered: {
|
2024-10-15 08:13:36 +00:00
|
|
|
root.viewProfileRequested()
|
2022-03-09 10:27:32 +00:00
|
|
|
root.close()
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-14 12:52:54 +00:00
|
|
|
StatusAction {
|
2024-08-27 07:34:00 +00:00
|
|
|
objectName: "userStatusCopyLinkAction"
|
2024-02-14 12:52:54 +00:00
|
|
|
text: qsTr("Copy link to profile")
|
|
|
|
icon.name: "copy"
|
|
|
|
onTriggered: {
|
2024-10-15 08:13:36 +00:00
|
|
|
root.copyLinkRequested()
|
2024-02-14 12:52:54 +00:00
|
|
|
root.close()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-15 08:13:36 +00:00
|
|
|
StatusMenuSeparator {}
|
2021-08-05 18:06:19 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-08-12 16:31:39 +00:00
|
|
|
objectName: "userStatusMenuAlwaysOnlineAction"
|
2022-06-10 09:01:31 +00:00
|
|
|
text: qsTr("Always online")
|
2022-12-01 16:58:37 +00:00
|
|
|
assetSettings.name: "statuses/online"
|
|
|
|
assetSettings.width: 12
|
|
|
|
assetSettings.height: 12
|
|
|
|
assetSettings.color: "transparent"
|
2024-10-15 08:13:36 +00:00
|
|
|
fontSettings.bold: root.currentUserStatus === Constants.currentUserStatus.alwaysOnline
|
2021-08-05 18:06:19 +00:00
|
|
|
onTriggered: {
|
2024-10-15 08:13:36 +00:00
|
|
|
root.setCurrentUserStatusRequested(Constants.currentUserStatus.alwaysOnline)
|
|
|
|
root.close()
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-08-12 16:31:39 +00:00
|
|
|
objectName: "userStatusMenuInactiveAction"
|
2022-06-10 09:01:31 +00:00
|
|
|
text: qsTr("Inactive")
|
2022-12-01 16:58:37 +00:00
|
|
|
assetSettings.name: "statuses/inactive"
|
|
|
|
assetSettings.width: 12
|
|
|
|
assetSettings.height: 12
|
|
|
|
assetSettings.color: "transparent"
|
2024-10-15 08:13:36 +00:00
|
|
|
fontSettings.bold: root.currentUserStatus === Constants.currentUserStatus.inactive
|
2021-08-05 18:06:19 +00:00
|
|
|
onTriggered: {
|
2024-10-15 08:13:36 +00:00
|
|
|
root.setCurrentUserStatusRequested(Constants.currentUserStatus.inactive)
|
|
|
|
root.close()
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
2022-06-10 09:01:31 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-08-12 16:31:39 +00:00
|
|
|
objectName: "userStatusMenuAutomaticAction"
|
2022-06-10 09:01:31 +00:00
|
|
|
text: qsTr("Set status automatically")
|
2022-12-01 16:58:37 +00:00
|
|
|
assetSettings.name: "statuses/automatic"
|
|
|
|
assetSettings.color: "transparent"
|
2024-10-15 08:13:36 +00:00
|
|
|
fontSettings.bold: root.currentUserStatus === Constants.currentUserStatus.automatic
|
2022-06-10 09:01:31 +00:00
|
|
|
onTriggered: {
|
2024-10-15 08:13:36 +00:00
|
|
|
root.setCurrentUserStatusRequested(Constants.currentUserStatus.automatic)
|
|
|
|
root.close()
|
2022-06-10 09:01:31 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|