Try to make the grid view with focus

This commit is contained in:
Luca Beltrame 2015-02-08 10:20:00 +01:00
parent 027bd6f6f5
commit 867f04daf8

View file

@ -38,8 +38,10 @@ Rectangle {
}
signal downloadRequested(url url)
signal fileInfo(url name, var tags)
Component {
// This is just for testing
id: highlight
Rectangle {
width: grid.cellWidth; height: grid.cellHeight
@ -62,6 +64,7 @@ Rectangle {
QPixmapItem {
id: pixItem
pixmap: thumbPix
anchors.horizontalCenter: parent.horizontalCenter
@ -78,6 +81,7 @@ Rectangle {
hoverEnabled: true
onClicked: {
grid.currentIndex = index
rootObj.fileInfo(fileUrl, tags)
}
onEntered: {
@ -152,7 +156,6 @@ Rectangle {
Text {
id: sizeText
text: i18n("File size: %1", KCoreAddons.Format.formatByteSize(fileSize))
// anchors.horizontalCenter: parent.horizontalCenter
}
Text {
id: resolutionText
@ -188,13 +191,17 @@ Rectangle {
flow: GridView.FlowLeftToRight
anchors.fill: parent
highlight: highlight
highlightFollowsCurrentItem: false
highlightFollowsCurrentItem: true
highlightRangeMode: GridView.StrictlyEnforceRange
model: danbooruModel
delegate: viewDelegate
focus: true
Component.onCompleted: currentIndex = -1
Component.onCompleted: { currentIndex = 0}
onAtYEndChanged: {
if (grid.atYEnd) {
danbooruService.getPostList(2, "", 10)
@ -209,4 +216,4 @@ Rectangle {
}
}
}