photos icon indicating copy to clipboard operation
photos copied to clipboard

use Gtk.FlowBox for icon view

Open elementaryBot opened this issue 8 years ago • 1 comments

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

Launchpad Details: #LP1356691 Daniel Fore - 2014-08-14 03:37:01 +0000


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

elementaryBot avatar Apr 18 '17 17:04 elementaryBot

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.

Launchpad Details: #LPC Jim Nelson - 2014-08-14 19:08:28 +0000

elementaryBot avatar Apr 18 '17 17:04 elementaryBot