FeedTheMonkey/Sidebar.qml
2015-02-03 19:50:05 +01:00

47 lines
870 B
QML

import QtQuick 2.0
import TTRSS 1.0
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.1
ScrollView {
id: item
property Server server
property Content content
function next() {
if(listView.count > listView.currentIndex) {
listView.currentIndex++;
}
}
function previous() {
if(listView.currentIndex > 0) {
listView.currentIndex--;
}
}
Layout.minimumWidth: 400
ListView {
id: listView
focus: true
anchors.fill: parent
spacing: 1
model: item.server.posts
delegate: Component {
PostListItem {}
}
highlight: Rectangle {
color: "lightblue"
opacity: 0.5
}
onCurrentItemChanged: {
item.content.post = server.posts[currentIndex]
}
}
}