qml: fix binding loop in ChatBlockDelegate

Rename 'chatView' property to 'parentListView' to avoid name collision
with the ListView id, which caused QML binding loop warnings.
This commit is contained in:
Levi Neely 2026-08-07 17:49:26 +02:00
parent 60c273e94a
commit 073cc2158b
2 changed files with 9 additions and 9 deletions

View File

@ -13,7 +13,7 @@ ColumnLayout {
required property var blockSegments
// Reference to parent ListView for scroll control
property var chatView: null
property ListView parentListView: null
// Expand state based on block type
property bool blockExpanded: {
@ -150,8 +150,8 @@ ColumnLayout {
selectedTextColor: theme.highlightedTextColor
onActiveFocusChanged: {
if (!activeFocus && root.chatView)
root.chatView.interactive = true
if (!activeFocus && root.parentListView)
root.parentListView.interactive = true
}
Menu {
@ -173,11 +173,11 @@ ColumnLayout {
propagateComposedEvents: true
cursorShape: Qt.IBeamCursor
onPressed: function(mouse) {
if (root.chatView) root.chatView.interactive = false
if (root.parentListView) root.parentListView.interactive = false
mouse.accepted = false
}
onReleased: function(mouse) {
if (root.chatView) root.chatView.interactive = true
if (root.parentListView) root.parentListView.interactive = true
mouse.accepted = false
}
}
@ -279,11 +279,11 @@ ColumnLayout {
propagateComposedEvents: true
cursorShape: Qt.IBeamCursor
onPressed: function(mouse) {
if (root.chatView) root.chatView.interactive = false
if (root.parentListView) root.parentListView.interactive = false
mouse.accepted = false
}
onReleased: function(mouse) {
if (root.chatView) root.chatView.interactive = true
if (root.parentListView) root.parentListView.interactive = true
mouse.accepted = false
}
}

View File

@ -929,7 +929,7 @@ ApplicationWindow {
delegate: ChatBlockDelegate {
width: chatView.width - 8
chatView: chatView
parentListView: chatView
}
}