Odysseus renders it’s downloads, when present, along the bottom of it’s window, wrapping them as to as many lines as needed. This is achieved using a GtkFlowBox, which I’ll be describing this morning.

Much of the code strongly resembles GtkListBox.

It specifies it’s minimum and natural widths as being the largest of it’s children, and similarly determines the height of each line. Then once it’s size is determined it tries to fit as many widgets in each line as possible before wrapping, taking slices of it’s children array. After which it distributes extra space to the children, then left/right/center alignment.

The one other interesting aspect of GtkFlowBox is that it’s get logic to automatically scroll it’s parent widgets via their GtkAdjustment model, upon a drag gesture.