2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-04-01 18:22:08 +00:00
|
|
|
import "../../../../imports"
|
2020-05-28 11:32:05 +00:00
|
|
|
import "../../../../shared"
|
2020-11-11 15:03:25 +00:00
|
|
|
import "../../../../shared/status"
|
2020-05-28 11:32:05 +00:00
|
|
|
import "../components"
|
2020-11-11 15:03:25 +00:00
|
|
|
StatusRoundButton {
|
2020-06-24 03:23:49 +00:00
|
|
|
id: btnAdd
|
2020-11-11 15:03:25 +00:00
|
|
|
pressedIconRotation: 45
|
|
|
|
icon.name: "plusSign"
|
|
|
|
size: "medium"
|
2021-03-16 19:19:48 +00:00
|
|
|
type: "secondary"
|
2020-05-28 11:32:05 +00:00
|
|
|
width: 36
|
|
|
|
height: 36
|
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
onClicked: {
|
2021-04-01 18:22:08 +00:00
|
|
|
if (newChatMenu.opened) {
|
|
|
|
newChatMenu.close()
|
|
|
|
} else {
|
|
|
|
let x = btnAdd.iconX + btnAdd.icon.width / 2 - newChatMenu.width / 2
|
|
|
|
newChatMenu.popup(x, btnAdd.height + 4)
|
|
|
|
}
|
2020-05-28 11:32:05 +00:00
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
|
|
|
|
PopupMenu {
|
|
|
|
id: newChatMenu
|
2021-04-01 18:22:08 +00:00
|
|
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
Action {
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Start new chat"
|
|
|
|
text: qsTrId("start-new-chat")
|
2020-06-24 03:23:49 +00:00
|
|
|
icon.source: "../../../img/new_chat.svg"
|
2020-08-14 12:08:09 +00:00
|
|
|
icon.width: 20
|
|
|
|
icon.height: 20
|
2020-12-11 20:38:10 +00:00
|
|
|
onTriggered: openPopup(privateChatPopupComponent)
|
2020-05-28 11:32:05 +00:00
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
Action {
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Start group chat"
|
|
|
|
text: qsTrId("start-group-chat")
|
2020-06-24 03:23:49 +00:00
|
|
|
icon.source: "../../../img/group_chat.svg"
|
2020-08-14 12:08:09 +00:00
|
|
|
icon.width: 20
|
|
|
|
icon.height: 20
|
2020-12-11 20:29:46 +00:00
|
|
|
onTriggered: openPopup(groupChatPopupComponent)
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
|
|
|
Action {
|
2020-07-06 20:39:55 +00:00
|
|
|
//% "Join public chat"
|
|
|
|
text: qsTrId("new-public-group-chat")
|
2020-06-24 03:23:49 +00:00
|
|
|
icon.source: "../../../img/public_chat.svg"
|
2020-08-14 12:08:09 +00:00
|
|
|
icon.width: 20
|
|
|
|
icon.height: 20
|
2020-12-11 20:29:46 +00:00
|
|
|
onTriggered: openPopup(publicChatPopupComponent)
|
|
|
|
}
|
|
|
|
Action {
|
2021-01-05 16:36:42 +00:00
|
|
|
enabled: appSettings.communitiesEnabled
|
2021-02-18 16:36:05 +00:00
|
|
|
//% "Communities"
|
|
|
|
text: qsTrId("communities")
|
2020-12-11 20:29:46 +00:00
|
|
|
icon.source: "../../../img/communities.svg"
|
|
|
|
icon.width: 20
|
|
|
|
icon.height: 20
|
|
|
|
onTriggered: {
|
|
|
|
openPopup(communitiesPopupComponent)
|
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
2021-04-01 18:22:08 +00:00
|
|
|
onAboutToShow: {
|
|
|
|
btnAdd.state = "pressed"
|
|
|
|
}
|
|
|
|
|
2020-06-24 03:23:49 +00:00
|
|
|
onAboutToHide: {
|
2020-11-11 15:03:25 +00:00
|
|
|
btnAdd.state = "default"
|
2020-05-28 11:32:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|