some list stuff

This commit is contained in:
Jeena 2015-01-21 20:08:16 +01:00
parent b24d2bef07
commit 0405a8ba39
2 changed files with 37 additions and 15 deletions

View file

@ -2,30 +2,48 @@ import QtQuick 2.0
Item { Item {
property ListView listView property ListView listView
height: column.height
height: column.height + 10
width: listView.parent.width
Rectangle { Rectangle {
color: "white"
anchors.margins: 10
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 10
anchors.rightMargin: 10
anchors.topMargin: 5
anchors.bottomMargin: 5
color: "transparent"
Column { Column {
id: column id: column
Row {
spacing: 10
Text { Text {
text: "[" + date.toLocaleString(null, "hh:mm:ss") + "] " + feedTitle text: feedTitle
font.pointSize: 9 font.pointSize: 9
color: "gray" color: "gray"
wrapMode: Text.Wrap wrapMode: Text.Wrap
} }
Text {
text: date.toLocaleString(null)
font.pointSize: 9
color: "gray"
wrapMode: Text.Wrap
}
}
Text { Text {
text: title text: title
font.pointSize: 12 font.pointSize: 12
wrapMode: Text.Wrap wrapMode: Text.Wrap
width: parent.width
} }
Text { Text {
text: excerpt text: excerpt
font.pointSize: 9 font.pointSize: 9
color: "gray" color: "gray"
wrapMode: Text.Wrap wrapMode: Text.Wrap
width: parent.width
} }
} }
} }

View file

@ -25,18 +25,15 @@ ApplicationWindow {
ListView { ListView {
id: listView id: listView
anchors.top: parent.top anchors.fill: parent
anchors.bottom: parent.bottom spacing: 1
spacing: 5
model: server.posts model: server.posts
delegate: PostListItem { delegate: delegate
listView: listView
}
highlight: Rectangle { highlight: Rectangle {
color: "lightblue" color: "lightblue"
opacity: 0.5 opacity: 0.5
focus: true
} }
focus: true
} }
} }
@ -65,6 +62,13 @@ ApplicationWindow {
id: server id: server
} }
Component {
id: delegate
PostListItem {
listView: listView
}
}
Component.onCompleted: { Component.onCompleted: {
if(serverLogin.loggedIn()) { if(serverLogin.loggedIn()) {
loggedIn(); loggedIn();