2023-05-19 16:07:50 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import StatusQ.Controls 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
|
|
|
|
import Storybook 1.0
|
|
|
|
import Models 1.0
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
import shared.views.chat 1.0
|
2024-09-06 15:55:44 +00:00
|
|
|
import shared.status 1.0
|
2023-05-19 16:07:50 +00:00
|
|
|
|
|
|
|
SplitView {
|
|
|
|
|
|
|
|
QtObject {
|
|
|
|
id: d
|
|
|
|
}
|
|
|
|
|
|
|
|
Logs { id: logs }
|
|
|
|
|
|
|
|
SplitView {
|
|
|
|
orientation: Qt.Vertical
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
SplitView.fillWidth: true
|
|
|
|
SplitView.fillHeight: true
|
|
|
|
color: Theme.palette.statusAppLayout.rightPanelBackgroundColor
|
|
|
|
clip: true
|
|
|
|
|
2024-09-06 15:55:44 +00:00
|
|
|
ColumnLayout {
|
2023-05-19 16:07:50 +00:00
|
|
|
anchors.centerIn: parent
|
2024-09-06 15:55:44 +00:00
|
|
|
spacing: 10
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Button {
|
|
|
|
text: "Message context menu"
|
|
|
|
onClicked: {
|
|
|
|
menu1.createObject(this).popup()
|
|
|
|
}
|
2023-05-19 16:07:50 +00:00
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
Button {
|
|
|
|
text: "Message context menu (hide disabled items)"
|
|
|
|
onClicked: {
|
|
|
|
menu2.createObject(this).popup()
|
|
|
|
}
|
2023-05-19 16:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: menu1
|
|
|
|
MessageContextMenuView {
|
2024-09-24 13:20:36 +00:00
|
|
|
id: messageContextMenuView
|
2023-05-19 16:07:50 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
hideDisabledItems: false
|
2024-09-24 13:20:36 +00:00
|
|
|
isDebugEnabled: isDebugEnabledCheckBox.checked
|
2023-05-19 16:07:50 +00:00
|
|
|
onClosed: {
|
|
|
|
destroy()
|
|
|
|
}
|
2024-09-24 13:20:36 +00:00
|
|
|
onPinMessage: () => {
|
|
|
|
logs.logEvent("Pin message:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onUnpinMessage: () => {
|
|
|
|
logs.logEvent("Unpin message:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onPinnedMessagesLimitReached: () => {
|
|
|
|
logs.logEvent("Pinned messages limit reached:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onMarkMessageAsUnread: () => {
|
|
|
|
logs.logEvent("Mark message as unread:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onToggleReaction: (emojiId) => {
|
|
|
|
logs.logEvent("Toggle reaction:", messageContextMenuView.messageId, emojiId)
|
|
|
|
}
|
|
|
|
onDeleteMessage: () => {
|
|
|
|
logs.logEvent("Delete message:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onEditClicked: () => {
|
|
|
|
logs.logEvent("Edit message:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onShowReplyArea: (senderId) => {
|
|
|
|
logs.logEvent("Show reply area:", messageContextMenuView.messageId, senderId)
|
|
|
|
}
|
|
|
|
onCopyToClipboard: (text) => {
|
|
|
|
logs.logEvent("Copy to clipboard:", text)
|
|
|
|
}
|
2023-05-19 16:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: menu2
|
|
|
|
MessageContextMenuView {
|
2024-09-24 13:20:36 +00:00
|
|
|
id: messageContextMenuView
|
2023-05-19 16:07:50 +00:00
|
|
|
anchors.centerIn: parent
|
|
|
|
hideDisabledItems: true
|
2024-09-24 13:20:36 +00:00
|
|
|
isDebugEnabled: isDebugEnabledCheckBox.checked
|
2023-05-19 16:07:50 +00:00
|
|
|
onClosed: {
|
|
|
|
destroy()
|
|
|
|
}
|
2024-09-24 13:20:36 +00:00
|
|
|
onPinMessage: () => {
|
|
|
|
logs.logEvent("Pin message:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onUnpinMessage: () => {
|
|
|
|
logs.logEvent("Unpin message:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onPinnedMessagesLimitReached: () => {
|
|
|
|
logs.logEvent("Pinned messages limit reached:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onMarkMessageAsUnread: () => {
|
|
|
|
logs.logEvent("Mark message as unread:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onToggleReaction: (emojiId) => {
|
|
|
|
logs.logEvent("Toggle reaction:", messageContextMenuView.messageId, emojiId)
|
|
|
|
}
|
|
|
|
onDeleteMessage: () => {
|
|
|
|
logs.logEvent("Delete message:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onEditClicked: () => {
|
|
|
|
logs.logEvent("Edit message:", messageContextMenuView.messageId)
|
|
|
|
}
|
|
|
|
onShowReplyArea: (senderId) => {
|
|
|
|
logs.logEvent("Show reply area:", messageContextMenuView.messageId, senderId)
|
|
|
|
}
|
|
|
|
onCopyToClipboard: (text) => {
|
|
|
|
logs.logEvent("Copy to clipboard:", text)
|
|
|
|
}
|
2023-05-19 16:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-06 15:55:44 +00:00
|
|
|
LogsAndControlsPanel {
|
|
|
|
id: logsAndControlsPanel
|
2023-05-19 16:07:50 +00:00
|
|
|
|
2024-09-06 15:55:44 +00:00
|
|
|
SplitView.minimumWidth: 150
|
|
|
|
SplitView.preferredWidth: 250
|
2023-05-19 16:07:50 +00:00
|
|
|
|
2024-09-06 15:55:44 +00:00
|
|
|
logsView.logText: logs.logText
|
2023-05-19 16:07:50 +00:00
|
|
|
|
2024-09-06 15:55:44 +00:00
|
|
|
controls: ColumnLayout {
|
|
|
|
spacing: 16
|
2024-09-24 13:20:36 +00:00
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
id: isDebugEnabledCheckBox
|
|
|
|
text: "Enable Debug"
|
|
|
|
checked: false
|
|
|
|
}
|
2023-05-19 16:07:50 +00:00
|
|
|
}
|
|
|
|
}
|
2024-09-06 15:55:44 +00:00
|
|
|
|
2023-05-19 16:07:50 +00:00
|
|
|
}
|
2023-07-31 12:21:14 +00:00
|
|
|
|
|
|
|
// category: Views
|