Explorar o código

Добавлен PullToRefresh для ListView

Denis V. Dedkov hai 1 ano
pai
achega
e793c1a375
Modificáronse 1 ficheiros con 15 adicións e 1 borrados
  1. 15 1
      resources/qml/HomeForm.qml

+ 15 - 1
resources/qml/HomeForm.qml

@@ -1,10 +1,14 @@
 import QtQuick 2.0
 import QtQuick.Controls 2.0
 
+import ru.ded.components 1.0
+
 Page {
     title: qsTr("nooLight")
 
     ListView {
+        id: listView
+
         anchors.fill: parent
         anchors.margins: 5
 
@@ -12,7 +16,7 @@ Page {
         spacing: 5
 
         delegate: LightGroup {
-            width: parent.width
+            width: listView.width
             height: childrenRect.height
 
             title: groupName || ""
@@ -22,6 +26,16 @@ Page {
                 lightsModel.switchChannel(channelId)
             }
         }
+
+        PoolToRefresh {
+            anchors.top: parent.top
+            width: parent.width
+            height: 30
+
+            onUpdate: {
+                lightsModel.reload()
+            }
+        }
     }
 
     BusyIndicator {