Settings dialog infrastructure
[quicknewsreader] / qml / QuickNewsReader / content / view / NewsDelegate.qml
index 517e86f..d51f3ee 100644 (file)
@@ -67,6 +67,7 @@ Item {
             }
 
             Text {
+                anchors.verticalCenter: detailImage.verticalCenter
                 text: description; width: column.width - detailImage.width - 10; wrapMode: Text.WordWrap
                 font.family: "Helvetica"
             }
@@ -76,11 +77,27 @@ Item {
     MouseArea {
         anchors.fill: delegate
 
-        onDoubleClicked: {
+        onClicked: {
             if (typeof detailedContent != "undefined") {
+                var currentSourceDepth = delegate.ListView.view.model.sourceDepth
+
+                // here we remove everything in viewsModel after index "nextSourceDepth"
+                while(window.windowViewsModel.count>currentSourceDepth+1)
+                    window.windowViewsModel.remove(window.windowViewsModel.count-1)
+
+                delegate.ListView.view.currentIndex = index
+                var path = listSourceModel[window.currentSourceIndex].currentPath
+                path[currentSourceDepth] = index
+                listSourceModel[window.currentSourceIndex].currentPath = path
+
+                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
-                currentNewsIndex = index
-           ////     journalsRect.x -= window.width + newsRect.x
+           ////     sourcesRect.x -= window.width + newsRect.x
                 //newsDetailRect.webViewAction.enabled = true
                 //newsDetailRect.webViewAction.trigger()
             }