2021-05-31 12:55:01 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Layout 0.1
|
2021-06-02 10:41:31 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2021-05-31 12:55:01 +00:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: demoApp
|
|
|
|
height: 602
|
|
|
|
width: 902
|
|
|
|
border.width: 1
|
|
|
|
border.color: Theme.palette.baseColor2
|
|
|
|
|
|
|
|
Row {
|
|
|
|
anchors.top: demoApp.top
|
|
|
|
anchors.left: demoApp.left
|
|
|
|
anchors.topMargin: 14
|
|
|
|
anchors.leftMargin: 14
|
|
|
|
|
|
|
|
spacing: 6
|
|
|
|
z: statusAppLayout.z + 1
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
color: "#E24640"
|
|
|
|
height: 12
|
|
|
|
width: 12
|
|
|
|
radius: 6
|
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
color: "#FFC12F"
|
|
|
|
height: 12
|
|
|
|
width: 12
|
|
|
|
radius: 6
|
|
|
|
}
|
|
|
|
Rectangle {
|
|
|
|
color: "#2ACB42"
|
|
|
|
height: 12
|
|
|
|
width: 12
|
|
|
|
radius: 6
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
StatusAppLayout {
|
|
|
|
id: statusAppLayout
|
|
|
|
anchors.top: demoApp.top
|
|
|
|
anchors.left: demoApp.left
|
|
|
|
anchors.topMargin: demoApp.border.width
|
|
|
|
anchors.leftMargin: demoApp.border.width
|
|
|
|
|
|
|
|
height: demoApp.height - demoApp.border.width * 2
|
|
|
|
width: demoApp.width - demoApp.border.width * 2
|
|
|
|
|
|
|
|
appNavBar: StatusAppNavBar {
|
|
|
|
|
2021-06-11 11:08:12 +00:00
|
|
|
id: navBar
|
|
|
|
|
2021-05-31 12:55:01 +00:00
|
|
|
navBarChatButton: StatusNavBarTabButton {
|
|
|
|
icon.name: "chat"
|
|
|
|
tooltip.text: "Chat"
|
|
|
|
checked: appView.sourceComponent == statusAppChatView
|
|
|
|
onClicked: {
|
|
|
|
appView.sourceComponent = statusAppChatView
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
navBarCommunityTabButtons.model: ListModel {
|
|
|
|
ListElement {
|
|
|
|
name: "Status Community"
|
|
|
|
tooltipText: "Status Community"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
navBarCommunityTabButtons.delegate: StatusNavBarTabButton {
|
2021-06-11 11:08:12 +00:00
|
|
|
id: communityBtn
|
2021-05-31 12:55:01 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
name: model.name
|
|
|
|
tooltip.text: model.tooltipText
|
|
|
|
icon.color: Theme.palette.miscColor6
|
|
|
|
icon.source: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
|
|
|
checked: appView.sourceComponent == statusAppCommunityView
|
|
|
|
onClicked: {
|
|
|
|
appView.sourceComponent = statusAppCommunityView
|
|
|
|
}
|
2021-06-11 11:08:12 +00:00
|
|
|
|
|
|
|
popupMenu: StatusPopupMenu {
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: qsTr("Invite People")
|
|
|
|
icon.name: "share-ios"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: qsTr("View Community")
|
|
|
|
icon.name: "group"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: qsTr("Edit Community")
|
|
|
|
icon.name: "edit"
|
2021-06-11 11:20:26 +00:00
|
|
|
enabled: false
|
2021-06-11 11:08:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: qsTr("Leave Community")
|
|
|
|
icon.name: "arrow-right"
|
|
|
|
icon.width: 14
|
|
|
|
iconRotation: 180
|
|
|
|
type: StatusMenuItem.Type.Danger
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
navBarTabButtons: [
|
|
|
|
StatusNavBarTabButton {
|
|
|
|
icon.name: "wallet"
|
|
|
|
tooltip.text: "Wallet"
|
|
|
|
},
|
|
|
|
StatusNavBarTabButton {
|
|
|
|
icon.name: "browser"
|
|
|
|
tooltip.text: "Browser"
|
|
|
|
},
|
|
|
|
StatusNavBarTabButton {
|
|
|
|
icon.name: "status-update"
|
|
|
|
tooltip.text: "Timeline"
|
|
|
|
},
|
|
|
|
StatusNavBarTabButton {
|
|
|
|
id: profileNavButton
|
|
|
|
icon.name: "profile"
|
|
|
|
badge.visible: true
|
|
|
|
badge.anchors.rightMargin: 4
|
|
|
|
badge.anchors.topMargin: 5
|
|
|
|
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusAppNavBar.backgroundColor
|
|
|
|
badge.border.width: 2
|
|
|
|
|
|
|
|
tooltip.text: "Profile"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
appView: Loader {
|
|
|
|
id: appView
|
|
|
|
anchors.fill: parent
|
|
|
|
sourceComponent: statusAppChatView
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: statusAppChatView
|
|
|
|
|
|
|
|
StatusAppTwoPanelLayout {
|
|
|
|
|
2021-06-17 12:58:19 +00:00
|
|
|
leftPanel: Item {
|
2021-05-31 12:55:01 +00:00
|
|
|
anchors.fill: parent
|
2021-06-17 12:58:19 +00:00
|
|
|
|
|
|
|
StatusNavigationPanelHeadline {
|
|
|
|
id: headline
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 16
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
text: "Chat"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusChatListAndCategories {
|
|
|
|
anchors.top: headline.bottom
|
|
|
|
anchors.topMargin: 16
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
chatList.model: demoChatListItems
|
|
|
|
selectedChatId: "0"
|
|
|
|
onChatItemSelected: selectedChatId = id
|
|
|
|
onChatItemUnmuted: {
|
|
|
|
for (var i = 0; i < demoChatListItems.count; i++) {
|
|
|
|
let item = demoChatListItems.get(i);
|
|
|
|
if (item.chatId === id) {
|
|
|
|
demoChatListItems.setProperty(i, "muted", false)
|
|
|
|
}
|
2021-06-07 09:16:18 +00:00
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rightPanel: Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
StatusChatToolBar {
|
|
|
|
anchors.top: parent.top
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
chatInfoButton.title: "Amazing Funny Squirrel"
|
|
|
|
chatInfoButton.subTitle: "Contact"
|
|
|
|
chatInfoButton.icon.color: Theme.palette.miscColor7
|
|
|
|
chatInfoButton.type: StatusChatInfoButton.Type.OneToOneChat
|
|
|
|
chatInfoButton.pinnedMessagesCount: 1
|
|
|
|
|
|
|
|
notificationCount: 1
|
|
|
|
|
|
|
|
onNotificationButtonClicked: notificationCount = 0
|
2021-06-02 10:41:31 +00:00
|
|
|
|
2021-06-08 13:45:27 +00:00
|
|
|
popupMenu: StatusPopupMenu {
|
2021-06-02 10:41:31 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: statusAppCommunityView
|
|
|
|
|
|
|
|
StatusAppTwoPanelLayout {
|
|
|
|
|
|
|
|
leftPanel: Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
2021-06-14 11:30:42 +00:00
|
|
|
StatusChatInfoToolBar {
|
2021-06-15 14:27:39 +00:00
|
|
|
id: statusChatInfoToolBar
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
2021-06-14 11:30:42 +00:00
|
|
|
chatInfoButton.title: "Cryptokitties"
|
|
|
|
chatInfoButton.subTitle: "128 Members"
|
|
|
|
chatInfoButton.image.source: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
|
|
|
chatInfoButton.icon.color: Theme.palette.miscColor6
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
|
|
popupMenu: StatusPopupMenu {
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Create channel"
|
|
|
|
icon.name: "channel"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Create category"
|
|
|
|
icon.name: "channel-category"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Invite people"
|
|
|
|
icon.name: "share-ios"
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-15 14:27:39 +00:00
|
|
|
StatusChatListAndCategories {
|
|
|
|
anchors.top: statusChatInfoToolBar.bottom
|
|
|
|
anchors.topMargin: 8
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
width: parent.width
|
2021-06-08 11:28:06 +00:00
|
|
|
|
2021-06-15 14:27:39 +00:00
|
|
|
chatList.model: demoCommunityChatListItems
|
|
|
|
categoryList.model: demoCommunityCategoryItems
|
2021-06-08 11:28:06 +00:00
|
|
|
|
2021-06-15 14:27:39 +00:00
|
|
|
showCategoryActionButtons: true
|
|
|
|
onChatItemSelected: selectedChatId = id
|
2021-06-08 11:28:06 +00:00
|
|
|
|
2021-06-15 14:27:39 +00:00
|
|
|
categoryPopupMenu: StatusPopupMenu {
|
2021-06-08 11:28:06 +00:00
|
|
|
|
2021-06-15 14:27:39 +00:00
|
|
|
property string categoryId
|
2021-06-08 11:28:06 +00:00
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Mute Category"
|
|
|
|
icon.name: "notification"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Mark as Read"
|
|
|
|
icon.name: "checkmark-circle"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Edit Category"
|
|
|
|
icon.name: "edit"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Delete Category"
|
|
|
|
icon.name: "delete"
|
|
|
|
type: StatusMenuItem.Type.Danger
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
2021-06-15 14:27:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
popupMenu: StatusPopupMenu {
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Create channel"
|
|
|
|
icon.name: "channel"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Create category"
|
|
|
|
icon.name: "channel-category"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
|
|
|
StatusMenuItem {
|
|
|
|
text: "Invite people"
|
|
|
|
icon.name: "share-ios"
|
|
|
|
}
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|
|
|
|
}
|
2021-06-15 14:27:39 +00:00
|
|
|
|
2021-05-31 12:55:01 +00:00
|
|
|
rightPanel: Item {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
StatusChatToolBar {
|
|
|
|
anchors.top: parent.top
|
|
|
|
width: parent.width
|
|
|
|
|
|
|
|
chatInfoButton.title: "general"
|
|
|
|
chatInfoButton.subTitle: "Community Chat"
|
|
|
|
chatInfoButton.icon.color: Theme.palette.miscColor6
|
|
|
|
chatInfoButton.type: StatusChatInfoButton.Type.CommunityChat
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-06-07 09:16:18 +00:00
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: demoChatListItems
|
|
|
|
ListElement {
|
|
|
|
chatId: "0"
|
|
|
|
name: "#status"
|
|
|
|
chatType: StatusChatListItem.Type.PublicChat
|
|
|
|
muted: false
|
|
|
|
hasUnreadMessages: false
|
|
|
|
hasMention: false
|
|
|
|
unreadMessagesCount: 0
|
|
|
|
iconColor: "blue"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
chatId: "1"
|
|
|
|
name: "#status-desktop"
|
|
|
|
chatType: StatusChatListItem.Type.PublicChat
|
|
|
|
muted: false
|
|
|
|
hasUnreadMessages: true
|
|
|
|
iconColor: "red"
|
|
|
|
unreadMessagesCount: 1
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
chatId: "2"
|
|
|
|
name: "Amazing Funny Squirrel"
|
|
|
|
chatType: StatusChatListItem.Type.OneToOneChat
|
|
|
|
muted: false
|
|
|
|
hasUnreadMessages: false
|
|
|
|
iconColor: "green"
|
|
|
|
identicon: "https://pbs.twimg.com/profile_images/1369221718338895873/T_5fny6o_400x400.jpg"
|
|
|
|
unreadMessagesCount: 0
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
chatId: "3"
|
|
|
|
name: "Black Ops"
|
|
|
|
chatType: StatusChatListItem.Type.GroupChat
|
|
|
|
muted: false
|
|
|
|
hasUnreadMessages: false
|
|
|
|
iconColor: "purple"
|
|
|
|
unreadMessagesCount: 0
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
chatId: "4"
|
|
|
|
name: "Spectacular Growing Otter"
|
|
|
|
chatType: StatusChatListItem.Type.OneToOneChat
|
|
|
|
muted: true
|
|
|
|
hasUnreadMessages: false
|
|
|
|
iconColor: "Orange"
|
|
|
|
unreadMessagesCount: 0
|
|
|
|
}
|
|
|
|
}
|
2021-06-07 12:16:37 +00:00
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: demoCommunityChatListItems
|
|
|
|
ListElement {
|
|
|
|
chatId: "0"
|
|
|
|
name: "general"
|
|
|
|
chatType: StatusChatListItem.Type.CommunityChat
|
|
|
|
muted: false
|
|
|
|
hasUnreadMessages: false
|
|
|
|
hasMention: false
|
|
|
|
unreadMessagesCount: 0
|
|
|
|
iconColor: "orange"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
chatId: "1"
|
|
|
|
name: "random"
|
|
|
|
chatType: StatusChatListItem.Type.CommunityChat
|
|
|
|
muted: false
|
|
|
|
hasUnreadMessages: false
|
|
|
|
hasMention: false
|
|
|
|
unreadMessagesCount: 0
|
|
|
|
iconColor: "orange"
|
2021-06-15 14:27:39 +00:00
|
|
|
categoryId: "public"
|
2021-06-07 12:16:37 +00:00
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
chatId: "2"
|
|
|
|
name: "watercooler"
|
|
|
|
chatType: StatusChatListItem.Type.CommunityChat
|
|
|
|
muted: false
|
|
|
|
hasUnreadMessages: false
|
|
|
|
hasMention: false
|
|
|
|
unreadMessagesCount: 0
|
|
|
|
iconColor: "orange"
|
2021-06-15 14:27:39 +00:00
|
|
|
categoryId: "public"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
chatId: "3"
|
|
|
|
name: "language-design"
|
|
|
|
chatType: StatusChatListItem.Type.CommunityChat
|
|
|
|
muted: false
|
|
|
|
hasUnreadMessages: false
|
|
|
|
hasMention: false
|
|
|
|
unreadMessagesCount: 0
|
|
|
|
iconColor: "orange"
|
|
|
|
categoryId: "dev"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ListModel {
|
|
|
|
id: demoCommunityCategoryItems
|
|
|
|
ListElement {
|
|
|
|
categoryId: "public"
|
|
|
|
name: "Public"
|
|
|
|
}
|
|
|
|
ListElement {
|
|
|
|
categoryId: "dev"
|
|
|
|
name: "Development"
|
2021-06-07 12:16:37 +00:00
|
|
|
}
|
|
|
|
}
|
2021-05-31 12:55:01 +00:00
|
|
|
}
|