2021-08-05 18:06:19 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQml.Models 2.3
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2022-03-09 10:27:32 +00:00
|
|
|
import shared.controls.chat 1.0
|
|
|
|
import shared.panels 1.0
|
2021-08-05 18:06:19 +00:00
|
|
|
|
2021-10-20 22:47:23 +00:00
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
2021-10-14 11:48:03 +00:00
|
|
|
// TODO: replace with StatusPopupMenu
|
2021-08-05 18:06:19 +00:00
|
|
|
PopupMenu {
|
|
|
|
id: root
|
2022-03-09 10:27:32 +00:00
|
|
|
|
2021-11-04 23:38:57 +00:00
|
|
|
property var store
|
2022-03-09 10:27:32 +00:00
|
|
|
|
|
|
|
width: 200
|
2021-09-27 10:31:17 +00:00
|
|
|
closePolicy: Popup.CloseOnReleaseOutsideParent | Popup.CloseOnEscape
|
2021-08-05 18:06:19 +00:00
|
|
|
|
2022-03-09 10:27:32 +00:00
|
|
|
overrideTextColor: Style.current.textColor
|
|
|
|
|
|
|
|
ProfileHeader {
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
displayName: root.store.userProfileInst.name
|
|
|
|
pubkey: root.store.userProfileInst.pubKey
|
|
|
|
icon: root.store.userProfileInst.icon
|
|
|
|
}
|
|
|
|
|
2021-08-05 18:06:19 +00:00
|
|
|
Item {
|
2022-03-09 10:27:32 +00:00
|
|
|
height: root.topPadding
|
|
|
|
}
|
2021-08-05 18:06:19 +00:00
|
|
|
|
2022-03-09 10:27:32 +00:00
|
|
|
Separator {
|
|
|
|
}
|
2021-08-05 18:06:19 +00:00
|
|
|
|
2022-03-09 10:27:32 +00:00
|
|
|
Action {
|
|
|
|
text: qsTr("View My Profile")
|
|
|
|
|
|
|
|
icon.source: Style.svg("profile")
|
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
|
|
|
|
|
|
|
onTriggered: {
|
|
|
|
Global.openProfilePopup(root.store.userProfileInst.pubKey)
|
|
|
|
root.close()
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
}
|
|
|
|
|
|
|
|
Action {
|
|
|
|
text: qsTr("Online")
|
|
|
|
onTriggered: {
|
2021-12-17 21:04:00 +00:00
|
|
|
//TODO move this to the store as soon as #4274 is merged
|
|
|
|
if (userProfile.userStatus !== true) {
|
|
|
|
mainModule.setUserStatus(true);
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
2021-11-22 11:08:09 +00:00
|
|
|
root.close();
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
icon.color: Style.current.green
|
2021-09-28 15:04:06 +00:00
|
|
|
icon.source: Style.svg("online")
|
2021-08-05 18:06:19 +00:00
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
|
|
|
}
|
|
|
|
|
|
|
|
Action {
|
|
|
|
text: qsTr("Offline")
|
|
|
|
onTriggered: {
|
2021-12-17 21:04:00 +00:00
|
|
|
//TODO move this to the store as soon as #4274 is merged
|
|
|
|
if (userProfile.userStatus !== false) {
|
|
|
|
mainModule.setUserStatus(false);
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
2021-11-22 11:08:09 +00:00
|
|
|
root.close();
|
2021-08-05 18:06:19 +00:00
|
|
|
}
|
|
|
|
|
2021-08-19 07:48:49 +00:00
|
|
|
icon.color: Style.current.midGrey
|
2021-09-28 15:04:06 +00:00
|
|
|
icon.source: Style.svg("offline")
|
2021-08-05 18:06:19 +00:00
|
|
|
icon.width: 16
|
|
|
|
icon.height: 16
|
|
|
|
}
|
|
|
|
}
|