status-desktop/ui/imports/shared/popups/UserStatusContextMenu.qml

99 lines
2.8 KiB
QML
Raw Normal View History

import QtQuick 2.12
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.3
import QtQml.Models 2.3
import utils 1.0
import shared.controls.chat 1.0
import shared.panels 1.0
import shared.controls.chat.menuItems 1.0
import StatusQ 0.1
import StatusQ.Components 0.1
import StatusQ.Popups 0.1
import AppLayouts.stores 1.0
2022-12-01 16:58:37 +00:00
StatusMenu {
id: root
property RootStore store
ProfileHeader {
width: parent.width
displayName: root.store.userProfileInst.name
pubkey: root.store.userProfileInst.pubKey
icon: root.store.userProfileInst.icon
userIsEnsVerified: !!root.store.userProfileInst.preferredName
objectName: 'onlineIdentifierProfileHeader'
}
StatusMenuSeparator {
}
ViewProfileMenuItem {
objectName: "userStatusViewMyProfileAction"
onTriggered: {
Global.openProfilePopup(root.store.userProfileInst.pubKey)
root.close()
}
}
StatusAction {
objectName: "userStatusCopyLinkAction"
text: qsTr("Copy link to profile")
icon.name: "copy"
onTriggered: {
ClipboardUtils.setText(root.store.contactStore.getLinkToProfile(root.store.userProfileInst.pubKey))
root.close()
}
}
StatusMenuSeparator {
}
2022-12-01 16:58:37 +00:00
StatusAction {
id: alwaysOnlineAction
objectName: "userStatusMenuAlwaysOnlineAction"
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"
fontSettings.bold: root.store.userProfileInst.currentUserStatus === Constants.currentUserStatus.alwaysOnline
onTriggered: {
store.setCurrentUserStatus(Constants.currentUserStatus.alwaysOnline)
root.close();
}
}
2022-12-01 16:58:37 +00:00
StatusAction {
id: inactiveAction
objectName: "userStatusMenuInactiveAction"
text: qsTr("Inactive")
2022-12-01 16:58:37 +00:00
assetSettings.name: "statuses/inactive"
assetSettings.width: 12
assetSettings.height: 12
assetSettings.color: "transparent"
fontSettings.bold: root.store.userProfileInst.currentUserStatus === Constants.currentUserStatus.inactive
onTriggered: {
store.setCurrentUserStatus(Constants.currentUserStatus.inactive)
root.close();
}
}
2022-12-01 16:58:37 +00:00
StatusAction {
id: automaticAction
objectName: "userStatusMenuAutomaticAction"
text: qsTr("Set status automatically")
2022-12-01 16:58:37 +00:00
assetSettings.name: "statuses/automatic"
assetSettings.color: "transparent"
fontSettings.bold: root.store.userProfileInst.currentUserStatus === Constants.currentUserStatus.automatic
onTriggered: {
store.setCurrentUserStatus(Constants.currentUserStatus.automatic)
root.close();
}
}
}