[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/base/plasma/declarative-applets/replacements/news/package
From:       Marco Martin <notmart () gmail ! com>
Date:       2011-03-26 17:29:33
Message-ID: 20110326172933.1DEE1AC8CA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1226098 by mart:

move the items list in its own component


 M  +1 -1      contents/ui/BasicComponents/ListItem.qml  
 M  +1 -1      contents/ui/BasicComponents/ListItemEntry.qml  
 M  +3 -7      contents/ui/ComplexComponents/FeedList.qml  
 A             contents/ui/ComplexComponents/ItemsList.qml   [License: LGPL (v2+)]
 M  +1 -0      contents/ui/ComplexComponents/qmldir  
 M  +2 -53     contents/ui/main.qml  
 M  +3 -63     platformcontents/application/tablet/ui/main.qml  


--- trunk/playground/base/plasma/declarative-applets/replacements/news/package/contents/ui/BasicComponents/ListItem.qml \
#1226097:1226098 @@ -26,7 +26,7 @@
     imagePath: "widgets/frame"
     prefix: "plain"
 
-    width: list.width
+    width: parent.width
     height: childrenRect.height
 
     property alias padding: paddingRectangle;
--- trunk/playground/base/plasma/declarative-applets/replacements/news/package/contents/ui/BasicComponents/ListItemEntry.qml \
#1226097:1226098 @@ -28,7 +28,7 @@
 
     Column {
         id : delegateLayout
-        width: list.width
+        width: parent.width
         spacing: 5
         anchors.left: listItem.padding.left
         anchors.right: listItem.padding.right
--- trunk/playground/base/plasma/declarative-applets/replacements/news/package/contents/ui/ComplexComponents/FeedList.qml \
#1226097:1226098 @@ -41,13 +41,13 @@
         }
     }
 
-    header: Column {
-        ListItemSource {
+    header: ListItemSource {
             id: feedListHeader
             text: i18n("Show All")
             unread: BookKeeping.totalUnreadCount
             onClicked: {
                 feedCategoryFilter.filterRegExp = ""
+                feedList.itemClicked()
             }
             Connections {
                 target: mainWindow
@@ -56,11 +56,7 @@
                 }
             }
         }
-        Item {
-            height: 5
-            width: 5
-        }
-    }
+
     delegate: ListItemSource {
         id: listItemSource
         text: feed_title
--- trunk/playground/base/plasma/declarative-applets/replacements/news/package/contents/ui/ComplexComponents/qmldir \
#1226097:1226098 @@ -1,2 +1,3 @@
 Toolbar 1.0 Toolbar.qml
 FeedList 1.0 FeedList.qml
+ItemsList 1.0 ItemsList.qml
--- trunk/playground/base/plasma/declarative-applets/replacements/news/package/contents/ui/main.qml \
#1226097:1226098 @@ -94,63 +94,12 @@
                     mainView.currentIndex = 1
                 }
 
-                ListView {
-                    id: list
+                ItemsList {
+                    id: itemsList
                     anchors.fill: listContainer
-                    spacing: 5;
-                    snapMode: ListView.SnapToItem
-
-                    clip: true
-                    model: PlasmaCore.SortFilterModel {
-                        id: postTitleFilter
-                        filterRole: "title"
-                        sortRole: "time"
-                        sortOrder: "DescendingOrder"
-                        filterRegExp: toolbarFrame.searchQuery
-                        sourceModel: PlasmaCore.SortFilterModel {
-                            id: feedCategoryFilter
-                            filterRole: "feed_url"
-                            sourceModel: PlasmaCore.DataModel {
-                                dataSource: feedSource
-                                keyRoleFilter: "items"
                             }
                         }
-                    }
 
-                    section.property: "feed_title"
-                    section.criteria: ViewSection.FullString
-                    section.delegate: ListItem {
-                        Text {
-                            color: theme.textColor
-                            text: section
-                            font.bold: true
-                        }
-                    }
-
-                    delegate: ListItemEntry {
-                        text: title
-                        date: Utils.date(time)
-
-                        Component.onCompleted: {
-                            if (BookKeeping.isArticleRead(link)) {
-                                opacity = 0.5
-                            } else {
-                                opacity = 1
-                            }
-                        }
-
-                        onClicked: {
-                            BookKeeping.setArticleRead(link, feed_url);
-                            opacity = 0.5;
-
-                            list.currentIndex = index
-                            bodyView.html = "<body \
                style=\"background:#fff;\">"+description+"</body>"
-                            mainView.currentIndex = 2
-                        }
-                    }
-                }
-            }
-
             PlasmaWidgets.WebView {
                 id : bodyView
                 dragToScroll : true
--- trunk/playground/base/plasma/declarative-applets/replacements/news/package/platformcontents/application/tablet/ui/main.qml \
#1226097:1226098 @@ -91,79 +91,19 @@
                 }
 
                 FeedList {
+                    id: feedList
                     anchors.fill: listContainer
                     anchors.rightMargin: listContainer.width/4*3
                 }
 
-                ListView {
-                    id: list
+                ItemsList {
+                    id: itemsList
                     anchors.fill: listContainer
                     anchors.leftMargin: listContainer.width/4
-                    spacing: 5;
-                    snapMode: ListView.SnapToItem
-
-                    PlasmaCore.SvgItem {
-                        width: 32
-                        anchors.top: parent.top
-                        anchors.left: parent.left
-                        anchors.bottom: parent.bottom
-                        svg: PlasmaCore.Svg{
-                            imagePath: plasmoid.file("images", "shadow.svgz")
                         }
-                        elementId: "right"
-                    }
 
-                    clip: true
-                    model: PlasmaCore.SortFilterModel {
-                        id: postTitleFilter
-                        filterRole: "title"
-                        sortRole: "time"
-                        sortOrder: "DescendingOrder"
-                        filterRegExp: toolbarFrame.searchQuery
-                        sourceModel: PlasmaCore.SortFilterModel {
-                            id: feedCategoryFilter
-                            filterRole: "feed_url"
-                            sourceModel: PlasmaCore.DataModel {
-                                dataSource: feedSource
-                                keyRoleFilter: "items"
                             }
-                        }
-                    }
 
-                    section.property: "feed_title"
-                    section.criteria: ViewSection.FullString
-                    section.delegate: ListItem {
-                        Text {
-                            color: theme.textColor
-                            text: section
-                            font.bold: true
-                        }
-                    }
-
-                    delegate: ListItemEntry {
-                        text: title
-                        date: Utils.date(time)
-
-                        Component.onCompleted: {
-                            if (BookKeeping.isArticleRead(link)) {
-                                opacity = 0.5
-                            } else {
-                                opacity = 1
-                            }
-                        }
-
-                        onClicked: {
-                            BookKeeping.setArticleRead(link, feed_url);
-                            opacity = 0.5;
-
-                            list.currentIndex = index
-                            bodyView.html = "<body \
                style=\"background:#fff;\">"+description+"</body>"
-                            mainView.currentIndex = 1
-                        }
-                    }
-                }
-            }
-
             PlasmaWidgets.WebView {
                 id : bodyView
                 dragToScroll : true


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic