Major changes
[quicknewsreader] / qml / QuickNewsReader / content / view / NewsDelegate.qml
index d51f3ee..bc5c88b 100644 (file)
@@ -59,6 +59,7 @@ Item {
 
 
         Row {
+            id: descriptionRow
             spacing: 5
 
             Image {
@@ -67,7 +68,7 @@ Item {
             }
 
             Text {
-                anchors.verticalCenter: detailImage.verticalCenter
+                anchors.verticalCenter: descriptionRow.verticalCenter
                 text: description; width: column.width - detailImage.width - 10; wrapMode: Text.WordWrap
                 font.family: "Helvetica"
             }
@@ -78,9 +79,10 @@ Item {
         anchors.fill: delegate
 
         onClicked: {
-            if (typeof detailedContent != "undefined") {
-                var currentSourceDepth = delegate.ListView.view.model.sourceDepth
+            var currentSourceDepth = delegate.ListView.view.model.sourceDepth
 
+            if (listSourceModel[window.currentSourceIndex].listViews.length >= currentSourceDepth+1)
+            {
                 // here we remove everything in viewsModel after index "nextSourceDepth"
                 while(window.windowViewsModel.count>currentSourceDepth+1)
                     window.windowViewsModel.remove(window.windowViewsModel.count-1)
@@ -88,18 +90,10 @@ Item {
                 delegate.ListView.view.currentIndex = index
                 var path = listSourceModel[window.currentSourceIndex].currentPath
                 path[currentSourceDepth] = index
-                listSourceModel[window.currentSourceIndex].currentPath = path
+                listSourceModel[window.currentSourceIndex].currentPath = path.slice(0,currentSourceDepth+1)
 
                 window.windowViewsModel.append({ component: listSourceModel[window.currentSourceIndex].listViews[currentSourceDepth].viewComponent,
-                                                 componentId: listSourceModel[window.currentSourceIndex].listViews[currentSourceDepth].viewId,
                                                  componentDepth: currentSourceDepth+1 })
-
-                window.windowViewsList.currentIndex = currentSourceDepth+1;
-
-                //newsDetailRect.webViewAction.enabled = false
-           ////     sourcesRect.x -= window.width + newsRect.x
-                //newsDetailRect.webViewAction.enabled = true
-                //newsDetailRect.webViewAction.trigger()
             }
         }
     }