Try to make the grid view with focus
This commit is contained in:
parent
027bd6f6f5
commit
867f04daf8
1 changed files with 11 additions and 4 deletions
|
@ -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 {
|
|||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue