Skip to content
Snippets Groups Projects
Commit 540fca7f authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf
Browse files

qml: dynamically define properties in ExpandGridView delegates when possible


Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent c8574062
No related branches found
No related tags found
No related merge requests found
......@@ -104,6 +104,16 @@ NavigableFocusScope {
}
function _defineObjProperty( obj, prop, value )
{
Object.defineProperty(obj, prop, {
"enumerable": true,
"configurable": false,
"value": value,
"writable": true,
})
}
//Gridview visible above the expanded item
Flickable {
id: flickable
......@@ -236,9 +246,11 @@ NavigableFocusScope {
for (i = firstId; i < topGridEndId; ++i) {
var pos = root.getItemPos(i)
var item = getChild(i, _unusedItemList)
item.model = model.items.get(i).model
item.index = i
_defineObjProperty(item, "index", i)
//theses needs an actual binding
item.selected = model.items.get(i).inSelected
item.model = model.items.get(i).model
//theses properties are always defined in Item
item.focus = false
item.x = pos[0]
item.y = pos[1]
......@@ -252,10 +264,12 @@ NavigableFocusScope {
for (i = topGridEndId; i < lastId; ++i) {
pos = root.getItemPos(i)
item = getChild(i, _unusedItemList)
_defineObjProperty(item, "index", i)
//theses needs an actual binding
item.selected = model.items.get(i).inSelected
item.model = model.items.get(i).model
//theses properties are always defined in Item
item.focus = false
item.index = i
item.selected = model.items.get(i).inSelected
item.x = pos[0]
item.y = pos[1] + expandItem.height
item.visible = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment