gui: use revision inside binding expression for proper dependency tracking
This commit is contained in:
parent
22980e376a
commit
670d759769
|
|
@ -1125,10 +1125,7 @@ ApplicationWindow {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
radius: 4
|
radius: 4
|
||||||
visible: type !== "header"
|
visible: type !== "header"
|
||||||
// Bind to revision so we re-evaluate when any agent state changes
|
|
||||||
property int _rev: ollie.agentStateRevision
|
|
||||||
color: {
|
color: {
|
||||||
void(_rev) // force dependency
|
|
||||||
if (type === "session") {
|
if (type === "session") {
|
||||||
var cc = connectionColor || "gray"
|
var cc = connectionColor || "gray"
|
||||||
if (cc === "green") return "#4caf50"
|
if (cc === "green") return "#4caf50"
|
||||||
|
|
@ -1136,9 +1133,11 @@ ApplicationWindow {
|
||||||
if (cc === "red") return "#f44336"
|
if (cc === "red") return "#f44336"
|
||||||
return "#9e9e9e"
|
return "#9e9e9e"
|
||||||
}
|
}
|
||||||
// Agent: gray if paused, else state color
|
// Agent: gray if paused, else state color from map
|
||||||
|
// Revision forces re-eval when any state changes
|
||||||
|
var rev = ollie.agentStateRevision
|
||||||
if (ollie.isSessionPaused(parentId)) return "#9e9e9e"
|
if (ollie.isSessionPaused(parentId)) return "#9e9e9e"
|
||||||
var s = ollie.agentState(parentId, agentId)
|
var s = rev >= 0 ? ollie.agentState(parentId, agentId) : "idle"
|
||||||
if (s === "idle") return "#4caf50"
|
if (s === "idle") return "#4caf50"
|
||||||
if (s.startsWith("calling")) return "#ff9800"
|
if (s.startsWith("calling")) return "#ff9800"
|
||||||
return "#2196f3"
|
return "#2196f3"
|
||||||
|
|
|
||||||
Reference in New Issue