status-desktop/ui/app/AppLayouts/Chat/ContactsColumn/AddChat.qml

74 lines
2.0 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import "../../../../imports"
2020-05-28 11:32:05 +00:00
import "../../../../shared"
import "../../../../shared/status"
2020-05-28 11:32:05 +00:00
import "../components"
StatusRoundButton {
id: btnAdd
pressedIconRotation: 45
icon.name: "plusSign"
size: "medium"
type: "secondary"
2020-05-28 11:32:05 +00:00
width: 36
height: 36
onClicked: {
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
}
PopupMenu {
id: newChatMenu
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
Action {
//% "Start new chat"
text: qsTrId("start-new-chat")
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
}
Action {
//% "Start group chat"
text: qsTrId("start-group-chat")
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)
}
Action {
//% "Join public chat"
text: qsTrId("new-public-group-chat")
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 {
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)
}
}
onAboutToShow: {
btnAdd.state = "pressed"
}
onAboutToHide: {
btnAdd.state = "default"
2020-05-28 11:32:05 +00:00
}
}
}