GtkIconView (gtk3) minimum height increases with each icon
Steps to reproduce
Run this sample script with the number of icons as single argument:
#!/usr/bin/env python3
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GdkPixbuf
icon = Gtk.IconTheme.load_icon(Gtk.IconTheme.get_default(), "gtk-ok", 96, 0)
class MyApp:
def __init__(self, count):
self.window = Gtk.Window()
self.window.connect("destroy", lambda w: Gtk.main_quit())
model = Gtk.ListStore(str, GdkPixbuf.Pixbuf)
self.iconview = Gtk.IconView.new_with_model(model)
self.iconview.set_text_column(0)
self.iconview.set_pixbuf_column(1)
self.window.add(self.iconview)
for i in range(count):
model.append(["label", icon])
self.window.show_all()
app = MyApp(int(sys.argv[1]))
Gtk.main()
Current behavior
The height of the widget increases with each item added, even though they are displayed in a single horizontal row. This height is also set as a hard minimum height, so users (or even wm) cannot adjust manually the height as a workaround.
Version information
Tested with Debian 11's 3.24.24-4+deb11u2, as well as locally-built 3.24.30.
Additional information
(screenshots without window frame, sorry, may be hard to visualize on white bg)
scripts/test-gtk-iconview.py 1
(correct size):
scripts/test-gtk-iconview.py 5
(excessive height, impossible to reduce):
(dummy paragraph to emphasize screenshot height)
Edited by Yann Dirson