Eventdelegate: Merge menu print and debug console
Also fix avatar-message spacing
This commit is contained in:
@@ -5,7 +5,7 @@ import "../../utils.js" as Utils
|
||||
|
||||
Row {
|
||||
id: eventContent
|
||||
spacing: theme.spacing / 2
|
||||
spacing: theme.spacing / 1.25
|
||||
|
||||
readonly property string eventText: Utils.processedEventText(model)
|
||||
readonly property string eventTime: Utils.formatTime(model.date)
|
||||
|
@@ -53,6 +53,19 @@ Column {
|
||||
property string hoveredImage: ""
|
||||
|
||||
|
||||
function json() {
|
||||
return JSON.stringify(
|
||||
Utils.getItem(
|
||||
modelSources[[
|
||||
"Event", chatPage.userId, chatPage.roomId
|
||||
]],
|
||||
"client_id",
|
||||
model.client_id
|
||||
),
|
||||
null, 4)
|
||||
}
|
||||
|
||||
|
||||
Daybreak {
|
||||
visible: dayBreak
|
||||
width: eventDelegate.width
|
||||
@@ -114,26 +127,14 @@ Column {
|
||||
Utils.copyToClipboard(selectableLabelContainer.joinedSelection)
|
||||
}
|
||||
|
||||
HMenuItem {
|
||||
icon.name: "settings"
|
||||
text: qsTr("Print event item")
|
||||
visible: debugMode
|
||||
onTriggered: print(JSON.stringify(Utils.getItem(
|
||||
modelSources[[
|
||||
"Event", chatPage.userId, chatPage.roomId
|
||||
]],
|
||||
"client_id",
|
||||
model.client_id
|
||||
), null, 4))
|
||||
}
|
||||
|
||||
HMenuItem {
|
||||
icon.name: "settings"
|
||||
text: qsTr("Set as debug console target")
|
||||
visible: debugMode
|
||||
onTriggered: {
|
||||
mainUI.debugConsole.target = [eventDelegate, eventContent]
|
||||
mainUI.debugConsole.runJS("t[0].json()")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user