2022-01-18 19:54:45 +00:00
|
|
|
import QtQuick 2.12
|
2022-01-19 22:33:29 +00:00
|
|
|
import QtQuick.Layouts 1.12
|
2022-01-18 19:54:45 +00:00
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Layout 0.1
|
2021-12-16 10:17:03 +00:00
|
|
|
import StatusQ.Core 0.1
|
2022-01-18 19:54:45 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
import "data" 1.0
|
|
|
|
|
2021-12-16 10:17:03 +00:00
|
|
|
StatusAppThreePanelLayout {
|
2022-01-18 19:54:45 +00:00
|
|
|
id: root
|
2022-01-19 22:33:29 +00:00
|
|
|
property bool createChat: false
|
2022-01-18 19:54:45 +00:00
|
|
|
|
|
|
|
leftPanel: Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
StatusNavigationPanelHeadline {
|
|
|
|
id: headline
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 16
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
text: "Chat"
|
|
|
|
}
|
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
RowLayout {
|
2022-01-18 19:54:45 +00:00
|
|
|
id: searchInputWrapper
|
2022-05-18 14:01:27 +00:00
|
|
|
width: 288
|
2022-01-18 19:54:45 +00:00
|
|
|
height: searchInput.height
|
2022-01-19 22:33:29 +00:00
|
|
|
anchors.top: headline.bottom
|
|
|
|
anchors.topMargin: 16
|
2022-05-18 14:01:27 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-01-18 19:54:45 +00:00
|
|
|
|
|
|
|
StatusBaseInput {
|
|
|
|
id: searchInput
|
2022-01-19 22:33:29 +00:00
|
|
|
Layout.fillWidth: true
|
2022-05-18 14:01:27 +00:00
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2022-01-19 22:33:29 +00:00
|
|
|
implicitHeight: 36
|
2022-01-18 19:54:45 +00:00
|
|
|
topPadding: 8
|
2022-04-07 20:50:36 +00:00
|
|
|
bottomPadding: 8
|
2022-01-18 19:54:45 +00:00
|
|
|
placeholderText: "Search"
|
|
|
|
icon.name: "search"
|
|
|
|
}
|
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
StatusIconTabButton {
|
|
|
|
icon.name: "public-chat"
|
|
|
|
}
|
2022-01-18 19:54:45 +00:00
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
StatusIconTabButton {
|
|
|
|
icon.name: "edit"
|
|
|
|
onClicked: {
|
|
|
|
root.createChat = !root.createChat;
|
2022-01-18 19:54:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
anchors.top: searchInputWrapper.bottom
|
|
|
|
anchors.topMargin: 16
|
2022-05-18 14:01:27 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2022-01-18 19:54:45 +00:00
|
|
|
spacing: 8
|
|
|
|
|
|
|
|
StatusContactRequestsIndicatorListItem {
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
title: "Contact requests"
|
|
|
|
requestsCount: 3
|
|
|
|
sensor.onClicked: demoContactRequestsModal.open()
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusChatList {
|
2022-02-01 15:20:57 +00:00
|
|
|
model: Models.demoChatListItems
|
2022-05-05 09:27:05 +00:00
|
|
|
highlightItem: !root.createChat
|
2022-01-18 19:54:45 +00:00
|
|
|
onChatItemUnmuted: {
|
|
|
|
for (var i = 0; i < Models.demoChatListItems.count; i++) {
|
|
|
|
let item = Models.demoChatListItems.get(i);
|
|
|
|
if (item.chatId === id) {
|
|
|
|
Models.demoChatListItems.setProperty(i, "muted", false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
popupMenu: StatusPopupMenu {
|
|
|
|
|
|
|
|
property string chatId
|
|
|
|
|
|
|
|
openHandler: function (id) {
|
|
|
|
chatId = id
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "View Profile"
|
|
|
|
icon.name: "group-chat"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Mute chat"
|
|
|
|
icon.name: "notification"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Mark as Read"
|
|
|
|
icon.name: "checkmark-circle"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Clear history"
|
|
|
|
icon.name: "close-circle"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Delete chat"
|
|
|
|
icon.name: "delete"
|
|
|
|
type: StatusMenuItem.Type.Danger
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-19 22:33:29 +00:00
|
|
|
centerPanel: Loader {
|
|
|
|
anchors.fill: parent
|
|
|
|
sourceComponent: root.createChat ? createChatView : chatChannelView
|
2022-05-10 16:04:27 +00:00
|
|
|
Component {
|
|
|
|
id: createChatView
|
|
|
|
CreateChatView {
|
2022-05-19 09:02:36 +00:00
|
|
|
contactsModel: Models.membersListModel
|
2022-05-10 16:04:27 +00:00
|
|
|
}
|
2022-01-19 22:33:29 +00:00
|
|
|
}
|
|
|
|
|
2022-05-10 16:04:27 +00:00
|
|
|
Component {
|
|
|
|
id: chatChannelView
|
|
|
|
ChatChannelView {
|
|
|
|
model: Models.chatMessagesModel
|
|
|
|
}
|
2022-01-19 22:33:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-18 19:54:45 +00:00
|
|
|
rightPanel: Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
StatusChatToolBar {
|
|
|
|
width: parent.width
|
2022-05-31 09:21:32 +00:00
|
|
|
toolbarComponent: statusChatInfoButton
|
2022-01-18 19:54:45 +00:00
|
|
|
searchButton.visible: false
|
|
|
|
membersButton.visible: false
|
|
|
|
notificationCount: 1
|
|
|
|
|
|
|
|
onNotificationButtonClicked: notificationCount = 0
|
|
|
|
|
|
|
|
popupMenu: StatusPopupMenu {
|
|
|
|
id: contextMenu
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Mute Chat"
|
|
|
|
icon.name: "notification"
|
|
|
|
}
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Mark as Read"
|
|
|
|
icon.name: "checkmark-circle"
|
|
|
|
}
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Clear History"
|
|
|
|
icon.name: "close-circle"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Leave Chat"
|
|
|
|
icon.name: "arrow-right"
|
|
|
|
icon.width: 14
|
|
|
|
iconRotation: 180
|
|
|
|
type: StatusMenuItem.Type.Danger
|
|
|
|
}
|
|
|
|
}
|
2022-05-31 09:21:32 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: statusChatInfoButton
|
|
|
|
|
|
|
|
StatusChatInfoButton {
|
|
|
|
width: Math.min(implicitWidth, parent.width)
|
|
|
|
title: "Amazing Funny Squirrel"
|
|
|
|
subTitle: "Contact"
|
|
|
|
icon.color: Theme.palette.miscColor7
|
|
|
|
type: StatusChatInfoButton.Type.OneToOneChat
|
|
|
|
pinnedMessagesCount: 1
|
|
|
|
}
|
|
|
|
}
|
2022-01-18 19:54:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|