32
property alias cellsPerRow: results.cellsPerRow
33
property alias contentY: results.contentY
34
property alias currentItem: results.currentItem
32
currentItem: focusPath.currentItem
34
property int contentHeight: grid.height + grid.anchors.topMargin + grid.anchors.bottomMargin
35
property alias cellsPerRow: grid.columns
36
36
property variant cellRenderer
37
37
property bool folded: true
39
38
property int cellWidth: 158
40
39
property int cellHeight: 76
41
property int horizontalSpacing: 26
42
property int verticalSpacing: 26
44
/* FIXME: using results_layout.anchors.topMargin in the following expression
45
causes QML to think they might be an anchor loop. */
46
property int totalHeight: results.count > 0 ? results_layout.anchors.topMargin + results.totalHeight : 0
41
property int minHorizontalSpacing: 26
42
property int minVerticalSpacing: 26
44
property bool centered: true
56
columns: Math.floor(parent.width/(renderer.cellWidth + renderer.minHorizontalSpacing))
57
anchors.top: parent.top
58
anchors.left: parent.left
59
anchors.right: parent.right
60
anchors.bottomMargin: 12
53
61
anchors.leftMargin: 2
63
property int itemHorizontalSpacing: renderer.centered ? Math.floor(renderer.width / columns - renderer.cellWidth) : renderer.minHorizontalSpacing
62
property int totalHeight: results.cellHeight*Math.ceil(count/cellsPerRow)
64
minHorizontalSpacing: renderer.horizontalSpacing
65
minVerticalSpacing: renderer.verticalSpacing
66
delegateWidth: renderer.cellWidth
67
delegateHeight: renderer.cellHeight
72
delegate: FocusScope {
74
width: results.cellWidth
75
height: results.cellHeight
72
width: renderer.cellWidth + grid.itemHorizontalSpacing
73
height: renderer.cellHeight + renderer.minVerticalSpacing
76
74
/* When hovered the item needs to be on top of every other item
77
75
in order for its label to not be covered */
78
76
z: ( loader.item.state == "selected" || loader.item.state == "hovered" ) ? 1 : 0
78
FocusPath.index: index
80
property string uri: column_0
81
property string iconHint: column_1
82
property string categoryId: column_2 // FIXME: rename to categoryIndex
83
property string mimetype: column_3
84
property string displayName: column_4 // FIXME: rename to name
85
property string comment: column_5
86
property string dndUri: column_6
82
property string uri: column_0
83
property string iconHint: column_1
84
property string categoryId: column_2 // FIXME: rename to categoryIndex
85
property string mimetype: column_3
86
property string displayName: column_4 // FIXME: rename to name
87
property string comment: column_5
88
property string dndUri: column_6
90
width: results.delegateWidth
91
height: results.delegateHeight
92
width: renderer.cellWidth
93
height: renderer.cellHeight
92
94
anchors.horizontalCenter: parent.horizontalCenter
95
anchors.verticalCenter: parent.verticalCenter
95
97
sourceComponent: cellRenderer