[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/base/plasma/declarative-applets/replacements/rssnow/package/contents/ui
From: Lukas Appelhans <l.appelhans () gmx ! de>
Date: 2010-12-08 18:27:31
Message-ID: 20101208182731.34E33AC8A5 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1204694 by lappelhans:
Now kinda working with the arrows
M +2 -2 ListItem.qml
M +45 -10 ListItemEntry.qml
M +15 -13 main.qml
--- trunk/playground/base/plasma/declarative-applets/replacements/rssnow/package/contents/ui/ListItem.qml \
#1204693:1204694 @@ -26,8 +26,8 @@
imagePath: "widgets/frame"
prefix: "plain"
- width: feedList.width
- height: childrenRect.height
+ width: entryList.width
+ height: entryList.height
property alias padding: paddingRectangle;
signal clicked;
--- trunk/playground/base/plasma/declarative-applets/replacements/rssnow/package/contents/ui/ListItemEntry.qml \
#1204693:1204694 @@ -26,38 +26,73 @@
property string text;
property string date;
- Column {
+ Row {
id : delegateLayout
- width: feedList.width
- height: feedList.height
+ width: entryList.width
+ height: entryList.height
spacing: 5
anchors.left: listItem.padding.left
anchors.right: listItem.padding.right
anchors.top: listItem.padding.top
- /*Text {
+ Text {
id: title
+ clip:true
width: delegateLayout.width - rightArrow.width
height: delegateLayout.height
color: theme.textColor
textFormat: Text.RichText
text: listItem.text
- }*/
+ }
/*Text {
color: theme.textColor
width: delegateLayout.width
horizontalAlignment: Text.AlignRight
text: '<em><small>'+listItem.date+'</em></small> '
}*/
- PlasmaWidgets.SvgWidget {
- width: mainWindow.width
- height: 50
- elementID: "right"
+ Column {
+ id: column
+ spacing: 5
+ PlasmaCore.SvgItem {
+ id: leftArrow
+ width: 20
+ height: 20
+ elementId: "left"
svg: PlasmaCore.Svg {
- id: headersvg
+ imagePath: "rssnow/left"
+ }
+ /*MouseArea {
+ anchors.fill: parent
+
+ onClicked: {
+ entryList.currentIndex = entryList.currentIndex - 1
+ }
+ }*/
+ }
+ PlasmaCore.SvgItem {
+ id: rightArrow
+ width: 20
+ height: 20
+ elementId: "right"
+ svg: PlasmaCore.Svg {
imagePath: "rssnow/right"
}
}
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (mouse.x < delegateLayout.width && mouse.x > \
(delegateLayout.width - leftArrow.width)) { + if (mouse.y > \
leftArrow.height) + entryList.currentIndex = \
entryList.currentIndex + 1 + else
+ entryList.currentIndex = entryList.currentIndex - 1
}
}
+ }
+}
+
+
+//mapFromItem ( Item item, real x, real y )
\ No newline at end of file
--- trunk/playground/base/plasma/declarative-applets/replacements/rssnow/package/contents/ui/main.qml \
#1204693:1204694 @@ -93,7 +93,7 @@
QGraphicsWidget {
id: feedListContainer
- ListView {
+ /*ListView {
id: feedList
anchors.fill: feedListContainer
signal itemClicked;
@@ -111,23 +111,29 @@
keyRoleFilter: "sources"
}
}
- delegate: ListView {
+ delegate: */ListView {
id: entryList
- anchors.fill: feedList
+ anchors.fill: feedListContainer
spacing: 5;
snapMode: ListView.SnapToItem
orientation: ListView.Horizontal
- width: feedList.width
+ width: feedListContainer.width
height: 50
clip: true
- model: /*PlasmaCore.SortFilterModel {
+ model: PlasmaCore.SortFilterModel {
filterRole: "feed_title"
sourceModel: PlasmaCore.DataModel {
dataSource: feedSource
+ keyRoleFilter: "items"
+ }
+ } /*PlasmaCore.SortFilterModel {
+ filterRole: "feed_title"
+ sourceModel: PlasmaCore.DataModel {
+ dataSource: feedSource
keyRoleFilter: "sources"
}
- }*/ListModel {
+ }*//*ListModel {
id: fruitModel
ListElement {
@@ -142,7 +148,7 @@
name: "Banana"
cost: 1.95
}
- } /*PlasmaCore.SortFilterModel {
+ }*/ /*PlasmaCore.SortFilterModel {
id: postTitleFilter
filterRole: "title"
sortRole: "time"
@@ -170,15 +176,11 @@
delegate: ListItemEntry {
id: listEntry
- text: "bla"
+ text: title
date: Utils.date(time)
-
- onClicked: {
- entryList.currentIndex = entryList.currentIndex + 1
}
}
+ //}
}
}
}
- }
-}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic