gui: use explicit properties for agent state dot binding
Create agentState and isPaused properties to ensure proper binding updates when model roles change via setProperty
This commit is contained in:
parent
9e5352f700
commit
457a6a55dc
|
|
@ -1125,6 +1125,8 @@ ApplicationWindow {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
radius: 4
|
radius: 4
|
||||||
visible: type !== "header"
|
visible: type !== "header"
|
||||||
|
property string agentState: (type === "agent") ? (state || "idle") : ""
|
||||||
|
property bool isPaused: (type === "agent") ? (parentPaused === true) : false
|
||||||
color: {
|
color: {
|
||||||
if (type === "session") {
|
if (type === "session") {
|
||||||
// Session: RPC connection health
|
// Session: RPC connection health
|
||||||
|
|
@ -1135,11 +1137,10 @@ ApplicationWindow {
|
||||||
return "#9e9e9e"
|
return "#9e9e9e"
|
||||||
}
|
}
|
||||||
// Agent: gray if parent session is paused
|
// Agent: gray if parent session is paused
|
||||||
if (parentPaused === true) return "#9e9e9e"
|
if (isPaused) return "#9e9e9e"
|
||||||
// Agent: use state role from model
|
// Agent: use state role from model
|
||||||
var s = state || "idle"
|
if (agentState === "idle") return "#4caf50"
|
||||||
if (s === "idle") return "#4caf50"
|
if (agentState.startsWith("calling")) return "#ff9800"
|
||||||
if (s.startsWith("calling")) return "#ff9800"
|
|
||||||
return "#2196f3"
|
return "#2196f3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in New Issue