use Gtk.FlowBox for icon view

Bug #1356691 reported by Danielle Foré
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Photos
New
Undecided
Unassigned

Bug Description

Is there a compelling reason not to use Gtk.FlowBox for the album/event/icon views?

Revision history for this message
Jim Nelson (yorba-jim) wrote :

Right now, Gtk.FlowBox requires widgets for all items be inserted into the view. For a basic display of an image with title beneath it with a bounding box, that's three widgets per photo. If a library has 10,000 photos, that's 30,000 widgets and 10,000 pixbufs in memory.

Resize performance is also a concern. If GtkFlowBox has to visit each child widget for a resize request, performance is going to be an issue with large libraries.

With a scrolling model-controller, widgets would be instantiated and destroyed as the scroll into and out of view. Presumably somewhere in the mix would be a way for the model-controller to specify the size of the uninstantiated widgets (or, better yet, a fixed size for all widgets). I know there's discussion among the GTK folks about implementing something like this for GtkFlowBox and GtkListBox.

Shotwell's CheckerboardLayout uses a custom model-controller for these reasons, although it doesn't use widgets for each photo, instead they paint directly to the Cairo canvas. Thumbnail pixbufs are demand-loaded as the viewport moves so there's never too many in memory at once time. Each photo and its text labels are fixed size, so calculating the flow doesn't require iteration of the children.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.