2022-01-18 19:54:45 +00:00
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.14
|
2022-09-02 07:25:43 +00:00
|
|
|
import QtQuick.Layouts 1.12
|
2022-01-18 19:54:45 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Popups 0.1
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Layout 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
|
|
|
import "data" 1.0
|
|
|
|
|
2022-09-02 07:25:43 +00:00
|
|
|
StatusSectionLayout {
|
2022-01-18 19:54:45 +00:00
|
|
|
id: root
|
|
|
|
|
|
|
|
property string communityDetailModalTitle: ""
|
|
|
|
property string communityDetailModalImage: ""
|
|
|
|
signal chatInfoButtonClicked()
|
|
|
|
|
|
|
|
handle: Rectangle {
|
|
|
|
implicitWidth: 5
|
|
|
|
color: SplitHandle.pressed ? Theme.palette.baseColor2
|
|
|
|
: (SplitHandle.hovered ? Qt.darker(Theme.palette.baseColor5, 1.1) : "transparent")
|
|
|
|
}
|
2022-09-02 07:25:43 +00:00
|
|
|
|
|
|
|
headerContent: RowLayout {
|
|
|
|
id: statusToolBar
|
|
|
|
|
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: searchButton
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
Layout.leftMargin: padding
|
|
|
|
icon.name: "search"
|
|
|
|
type: StatusFlatRoundButton.Type.Secondary
|
|
|
|
// initializing the tooltip
|
|
|
|
tooltip.text: qsTr("Search")
|
|
|
|
tooltip.orientation: StatusToolTip.Orientation.Bottom
|
|
|
|
tooltip.y: parent.height + 12
|
|
|
|
onClicked: {
|
|
|
|
searchButton.highlighted = !searchButton.highlighted;
|
|
|
|
searchPopup.setSearchSelection(communityDetailModalTitle,
|
|
|
|
"",
|
|
|
|
communityDetailModalImage);
|
|
|
|
searchPopup.open();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusChatInfoButton {
|
|
|
|
Layout.preferredWidth: Math.min(implicitWidth, parent.width)
|
|
|
|
Layout.fillHeight: true
|
|
|
|
title: "general"
|
|
|
|
subTitle: "Community Chat"
|
2022-09-02 15:40:30 +00:00
|
|
|
asset.color: Theme.palette.miscColor6
|
2022-09-02 07:25:43 +00:00
|
|
|
type: StatusChatInfoButton.Type.CommunityChat
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: membersButton
|
|
|
|
icon.name: "group-chat"
|
|
|
|
type: StatusFlatRoundButton.Type.Secondary
|
|
|
|
// initializing the tooltip
|
|
|
|
tooltip.text: qsTr("Members")
|
|
|
|
tooltip.orientation: StatusToolTip.Orientation.Bottom
|
|
|
|
tooltip.y: parent.height + 12
|
|
|
|
onClicked: {
|
|
|
|
membersButton.highlighted = !membersButton.highlighted;
|
|
|
|
root.showRightPanel = !root.showRightPanel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusSearchPopup {
|
|
|
|
id: searchPopup
|
|
|
|
searchOptionsPopupMenu: searchPopupMenu
|
|
|
|
onAboutToHide: {
|
|
|
|
if (searchPopupMenu.visible) {
|
|
|
|
searchPopupMenu.close();
|
|
|
|
}
|
|
|
|
//clear menu
|
|
|
|
for (var i = 2; i < searchPopupMenu.count; i++) {
|
|
|
|
searchPopupMenu.removeItem(searchPopupMenu.takeItem(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onClosed: {
|
|
|
|
statusToolBar.searchButton.highlighted = false
|
|
|
|
searchPopupMenu.dismiss();
|
|
|
|
}
|
|
|
|
onSearchTextChanged: {
|
|
|
|
if (searchPopup.searchText !== "") {
|
|
|
|
searchPopup.loading = true;
|
|
|
|
searchModelSimTimer.start();
|
|
|
|
} else {
|
|
|
|
searchPopup.searchResults = [];
|
|
|
|
searchModelSimTimer.stop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Timer {
|
|
|
|
id: searchModelSimTimer
|
|
|
|
interval: 500
|
|
|
|
onTriggered: {
|
|
|
|
if (searchPopup.searchText.startsWith("c")) {
|
|
|
|
searchPopup.searchResults = Models.searchResultsA;
|
|
|
|
} else {
|
|
|
|
searchPopup.searchResults = Models.searchResultsB;
|
|
|
|
}
|
|
|
|
searchPopup.loading = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
StatusSearchLocationMenu {
|
|
|
|
id: searchPopupMenu
|
|
|
|
locationModel: Models.optionsModel
|
2022-12-01 16:58:37 +00:00
|
|
|
|
|
|
|
onResetSearchSelection: {
|
|
|
|
searchPopup.resetSearchSelection()
|
|
|
|
}
|
|
|
|
|
|
|
|
onSetSearchSelection: {
|
|
|
|
searchPopup.setSearchSelection(text,
|
|
|
|
secondaryText,
|
|
|
|
imageSource,
|
|
|
|
isIdenticon,
|
|
|
|
iconName,
|
|
|
|
iconColor,
|
|
|
|
isUserIcon,
|
|
|
|
colorId,
|
|
|
|
colorHash)
|
|
|
|
}
|
2022-09-02 07:25:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-18 19:54:45 +00:00
|
|
|
leftPanel: Item {
|
|
|
|
id: leftPanel
|
|
|
|
|
|
|
|
StatusChatInfoToolBar {
|
|
|
|
id: statusChatInfoToolBar
|
|
|
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
|
|
|
|
chatInfoButton.title: "CryptoKitties"
|
|
|
|
chatInfoButton.subTitle: "128 Members"
|
2022-09-02 15:40:30 +00:00
|
|
|
chatInfoButton.asset.isImage: true
|
|
|
|
chatInfoButton.asset.name: "qrc:/demoapp/data/profile-image-1.jpeg"
|
|
|
|
chatInfoButton.asset.color: Theme.palette.miscColor6
|
2022-01-18 19:54:45 +00:00
|
|
|
chatInfoButton.onClicked: { chatInfoButtonClicked(); }
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
popupMenu: StatusMenu {
|
2022-01-18 19:54:45 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Create channel"
|
|
|
|
icon.name: "channel"
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Create category"
|
|
|
|
icon.name: "channel-category"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Invite people"
|
|
|
|
icon.name: "share-ios"
|
2023-09-13 13:22:33 +00:00
|
|
|
objectName: "invitePeople"
|
2022-01-18 19:54:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-14 12:29:14 +00:00
|
|
|
StatusScrollView {
|
2022-01-18 19:54:45 +00:00
|
|
|
id: scrollView
|
|
|
|
|
|
|
|
anchors.top: statusChatInfoToolBar.bottom
|
|
|
|
anchors.topMargin: 8
|
|
|
|
anchors.bottom: parent.bottom
|
2023-05-31 20:58:23 +00:00
|
|
|
width: parent.width
|
2022-01-18 19:54:45 +00:00
|
|
|
|
2023-05-31 20:58:23 +00:00
|
|
|
contentWidth: availableWidth
|
2022-01-18 19:54:45 +00:00
|
|
|
clip: true
|
|
|
|
|
|
|
|
StatusChatListAndCategories {
|
|
|
|
id: communityCategories
|
2023-05-31 20:58:23 +00:00
|
|
|
|
|
|
|
width: scrollView.availableWidth
|
2022-01-18 19:54:45 +00:00
|
|
|
height: implicitHeight > (leftPanel.height - 64) ? implicitHeight + 8 : leftPanel.height - 64
|
|
|
|
|
|
|
|
draggableItems: true
|
|
|
|
draggableCategories: false
|
2022-02-01 15:20:57 +00:00
|
|
|
model: Models.demoCommunityChatListItems
|
2022-01-18 19:54:45 +00:00
|
|
|
|
|
|
|
showCategoryActionButtons: true
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
categoryPopupMenu: StatusMenu {
|
2022-01-18 19:54:45 +00:00
|
|
|
|
|
|
|
property string categoryId
|
|
|
|
|
|
|
|
openHandler: function (id) {
|
|
|
|
categoryId = id
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Mute Category"
|
|
|
|
icon.name: "notification"
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Mark as Read"
|
|
|
|
icon.name: "checkmark-circle"
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Edit Category"
|
|
|
|
icon.name: "edit"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Delete Category"
|
|
|
|
icon.name: "delete"
|
2022-12-01 16:58:37 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2022-01-18 19:54:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
chatListPopupMenu: StatusMenu {
|
2022-01-18 19:54:45 +00:00
|
|
|
|
|
|
|
property string chatId
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Mute chat"
|
|
|
|
icon.name: "notification"
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Mark as Read"
|
|
|
|
icon.name: "checkmark-circle"
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Clear history"
|
|
|
|
icon.name: "close-circle"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Delete chat"
|
|
|
|
icon.name: "delete"
|
2022-12-01 16:58:37 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2022-01-18 19:54:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
popupMenu: StatusMenu {
|
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Create channel"
|
|
|
|
icon.name: "channel"
|
|
|
|
}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Create category"
|
|
|
|
icon.name: "channel-category"
|
|
|
|
}
|
|
|
|
|
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2022-01-18 19:54:45 +00:00
|
|
|
text: "Invite people"
|
|
|
|
icon.name: "share-ios"
|
2023-09-13 13:22:33 +00:00
|
|
|
objectName: "invitePeople"
|
2022-01-18 19:54:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
centerPanel: Item {
|
2022-09-02 07:25:43 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
StatusBaseText {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
font.pixelSize: 15
|
|
|
|
text: qsTr("Community content here")
|
2022-01-18 19:54:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rightPanel: Item {
|
|
|
|
id: rightPanel
|
|
|
|
StatusBaseText {
|
|
|
|
id: titleText
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin:16
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 16
|
|
|
|
opacity: (rightPanel.width > 50) ? 1.0 : 0.0
|
|
|
|
visible: (opacity > 0.1)
|
|
|
|
font.pixelSize: 15
|
|
|
|
text: qsTr("Members")
|
|
|
|
}
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
anchors.top: titleText.bottom
|
|
|
|
anchors.topMargin: 16
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 8
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 8
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: 16
|
|
|
|
boundsBehavior: Flickable.StopAtBounds
|
2022-01-28 14:29:29 +00:00
|
|
|
model: Models.membersListModel
|
|
|
|
delegate: StatusMemberListItem {
|
|
|
|
implicitWidth: parent.width
|
2022-06-12 14:25:17 +00:00
|
|
|
nickName: model.localNickname
|
|
|
|
userName: model.displayName
|
|
|
|
pubKey: model.pubKey
|
|
|
|
isVerified: model.isVerified
|
|
|
|
isUntrustworthy: model.isUntrustworthy
|
|
|
|
isContact: model.isContact
|
|
|
|
status: model.onlineStatus
|
2022-01-18 19:54:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|