Hello everyone!
Possibly a silly question, but I have the blueprint for a ListItemFactory in a blueprint file below.
I would like to be able to change the size of the Picture, and thus, the row, without having to recreate the entire ListView
.
using Gtk 4.0;
using Adw 1;
BuilderListItemFactory list_view_factory {
template ListItem {
child: Adw.Clamp list_width_clamp {
orientation: horizontal;
maximum-size: bind template.item as <$MyItem>.picture as <$MyPicture>.width;
child: Picture pic {
paintable: bind template.item as <$MyItem>.picture;
height-request: bind template.item as <$MyItem>.picture as <$MyPicture>.height;
content-fit: cover;
vexpand: true;
};
};
}
}
If I change the height
property, the allocated height for each ListItem
row stays the same. Emitting ListModel.items_changed
does not affect it either.
Unsetting and resetting the factory for the ListView
“works”, but that recreates all of the widgets, so it’s not exactly a great solution
Any help or pointers are greatly appreciated. Thank you!!