ConnectionStatus.qml 498 B

12345678910111213141516171819202122232425
  1. import QtQuick 2.15
  2. Rectangle {
  3. id: connectionDot
  4. property var backend: null
  5. width: 12
  6. height: 12
  7. radius: 6
  8. // Direct property binding to backend.serialConnected
  9. color: {
  10. if (!backend) return "#FF5722"
  11. return backend.serialConnected ? "#4CAF50" : "#FF5722"
  12. }
  13. // Animate color changes
  14. Behavior on color {
  15. ColorAnimation {
  16. duration: 300
  17. easing.type: Easing.OutQuart
  18. }
  19. }
  20. }