DelegateBase: Fixed to support delegate without image
authorJanne Kiiski <janne.kiiski@ixonos.com>
Tue, 23 Nov 2010 09:48:06 +0000 (11:48 +0200)
committerJanne Kiiski <janne.kiiski@ixonos.com>
Tue, 23 Nov 2010 11:36:09 +0000 (13:36 +0200)
src/qmlui/DelegateBase.qml

index fe15972..3c8eaba 100644 (file)
@@ -59,11 +59,13 @@ Item {
         y: 4
         height: 50
         width: 50
+        visible: source != ""
     }
 
-    BusyIndicator { anchors.centerIn: image; on: image.status != Image.Ready }
+    BusyIndicator { anchors.centerIn: image; on: image.visible && image.status != Image.Ready }
 
     BorderImage {
+        visible: image.visible
         id: borderImage
         anchors.fill: image
         anchors.margins: -8
@@ -76,7 +78,7 @@ Item {
 
     Text {
         id: primaryText
-        anchors { left: image.right; right: background.right; top: background.top; margins: 5; leftMargin: 10 }
+        anchors { left: image.visible ? image.right : background.left; right: background.right; top: background.top; margins: 5; leftMargin: 10 }
         clip: true;
         elide: Text.ElideRight
         Behavior on height {