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
|
||||
radius: 4
|
||||
visible: type !== "header"
|
||||
property string agentState: (type === "agent") ? (state || "idle") : ""
|
||||
property bool isPaused: (type === "agent") ? (parentPaused === true) : false
|
||||
color: {
|
||||
if (type === "session") {
|
||||
// Session: RPC connection health
|
||||
|
|
@ -1135,11 +1137,10 @@ ApplicationWindow {
|
|||
return "#9e9e9e"
|
||||
}
|
||||
// Agent: gray if parent session is paused
|
||||
if (parentPaused === true) return "#9e9e9e"
|
||||
if (isPaused) return "#9e9e9e"
|
||||
// Agent: use state role from model
|
||||
var s = state || "idle"
|
||||
if (s === "idle") return "#4caf50"
|
||||
if (s.startsWith("calling")) return "#ff9800"
|
||||
if (agentState === "idle") return "#4caf50"
|
||||
if (agentState.startsWith("calling")) return "#ff9800"
|
||||
return "#2196f3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in New Issue