HomeForm.qml 844 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import QtQuick 2.0
  2. import QtQuick.Controls 2.0
  3. import ru.ded.components 1.0
  4. Page {
  5. title: qsTr("nooLight")
  6. ListView {
  7. id: listView
  8. anchors.fill: parent
  9. anchors.margins: 5
  10. model: lightsModel
  11. spacing: 5
  12. delegate: LightGroup {
  13. width: listView.width
  14. height: childrenRect.height
  15. title: groupName || ""
  16. lights: channels
  17. onChannelClicked: {
  18. lightsModel.switchChannel(channelId)
  19. }
  20. }
  21. PoolToRefresh {
  22. anchors.top: parent.top
  23. width: parent.width
  24. height: 30
  25. onUpdate: {
  26. lightsModel.reload()
  27. }
  28. }
  29. }
  30. BusyIndicator {
  31. anchors.centerIn: parent
  32. running: lightsModel.isLoading
  33. }
  34. }