on xenial help sign in
Make the delegate of DashNavigationList an async Loader
eb20050Albert Astals Cid
qml/Dash/DashNavigationList.qml+48−45
@@ -53,61 +53,64 @@ Item {
53 Repeater {
53 Repeater {
54 model: navigation && navigation.loaded ? navigation : null
54 model: navigation && navigation.loaded ? navigation : null
55 clip: true
55 clip: true
56− // FIXME Move to ListItem (and remove import) once 1556971 is fixed
57− delegate: ListItems.Empty {
56+ delegate: Loader {
58− objectName: root.objectName + "child" + index
57+ asynchronous: true
59 height: root.itemHeight
58 height: root.itemHeight
60 width: column.width
59 width: column.width
61− anchors {
60+ // FIXME Move to ListItem (and remove import) once 1556971 is fixed
62− left: column.left
61+ sourceComponent: ListItems.Empty {
63− right: column.right
62+ objectName: root.objectName + "child" + index
64− leftMargin: units.gu(2)
65− rightMargin: units.gu(2)
66− }
67−
68− onClicked: root.enterNavigation(navigationId, allLabel != "" ? allLabel : label, hasChildren)
69−
70− Icon {
71− id: leftIcon
72 anchors {
63 anchors {
73− verticalCenter: parent.verticalCenter
74 left: parent.left
64 left: parent.left
65+ right: parent.right
66+ leftMargin: units.gu(2)
67+ rightMargin: units.gu(2)
75 }
68 }
76− height: units.gu(2)
77− width: height
78− name: "tick"
79− color: "#3EB34F"
80− visible: isActive
81− }
82
69
83− Label {
70+ onClicked: root.enterNavigation(navigationId, allLabel != "" ? allLabel : label, hasChildren)
84− anchors {
71+
85− verticalCenter: parent.verticalCenter
72+ Icon {
86− left: leftIcon.right
73+ id: leftIcon
87− leftMargin: units.gu(1)
74+ anchors {
88− right: rightIcon.left
75+ verticalCenter: parent.verticalCenter
76+ left: parent.left
77+ }
89− rightMargin: units.gu(2)
78+ height: units.gu(2)
79+ width: height
80+ name: "tick"
81+ color: "#3EB34F"
82+ visible: isActive
90 }
83 }
91− text: label
92− color: isActive ? "#333333" : "#888888"
93− wrapMode: Text.Wrap
94− maximumLineCount: 2
95− elide: Text.ElideMiddle
96− }
97
84
85+ Label {
86+ anchors {
87+ verticalCenter: parent.verticalCenter
88+ left: leftIcon.right
89+ leftMargin: units.gu(1)
90+ right: rightIcon.left
91+ rightMargin: units.gu(2)
92+ }
93+ text: label
94+ color: isActive ? "#333333" : "#888888"
95+ wrapMode: Text.Wrap
96+ maximumLineCount: 2
97+ elide: Text.ElideMiddle
98+ }
99+
98− Icon {
100+ Icon {
99− id: rightIcon
101+ id: rightIcon
100− anchors {
102+ anchors {
101− verticalCenter: parent.verticalCenter
103+ verticalCenter: parent.verticalCenter
102− right: parent.right
104+ right: parent.right
105+ }
106+ height: units.gu(2)
107+ width: height
108+ name: "go-next"
109+ visible: hasChildren
103 }
110 }
104− height: units.gu(2)
105− width: height
106− name: "go-next"
107− visible: hasChildren
108− }
109
111
110− divider.visible: index != navigation.count - 1
112+ divider.visible: index != navigation.count - 1
113+ }
111 }
114 }
112 }
115 }
113 }
116 }