I am having scrolling issues with GtkIconView in GNOME Activity Journal:
GNOME Activity Journal has 3 view modes. One of them is a ThumbView which uses GtkIconView to render thumbnails of events.
Please refer to the following 2 screenshots:
Smaller Thumbnails - No scrolling needed case:
Larger Thumbnails - Scrolling needed case:
There are 3 GtkIconView objects above - one for morning, afternoon and evening events.
The issue here is, GtkIconView doesn’t wrap around and use the vertical space in the second image ( morning and afternoon icon views ) , even when there is enough vertical space available for the thumbnails. When the vertical allocated space gets more and more ( much more than actually required ), at some point GtkIconView wraps around to render thumbnails in the second row.
When GtkScrolledWindow is added to each GtkIconView, the vertical space is properly utilized, as soon as enough vertical space is available. But, that’s not what we want here. The idea here is to add a single GtkScrolledWindow for all 3 GtkIconView objects, so they fully expand to their minimum required sizes, rather than having individual scrollbars for each GtkIconView.
Below is the rough python3 pseudo-code:
class ThumbViewContainer(Gtk.VBox): def __init__(self): self.scrolledwindow = Gtk.ScrolledWindow() self.view = ThumbView() self.scrolledwindow.add(self.view) class ThumbView(Gtk.VBox): def __init__(self): for text in (morning, afternoon, evening): label = Gtk.Label() label.set_markup(text) self.views.append(ThumbIconView()) self.labels.append(label) self.pack_start(label, False, False, 0) self.pack_start(self.views[-1], True, True, 0) class ThumbIconView(Gtk.IconView): def __init__(self): self.show_thumbnails()
Full code at: