Pictures will explain the title:
Under LMDE & Ubuntu 12.04 my GtkIconView looks like this - its correct in terms of the spacing between the icons:
Under Ubuntu 12.10, 13.04 & Fedora 17 the same code displays as follows:
N.B. - This is a rhythmbox python plugin - source code is here on GitHub
I've checked the following GtkIconView attributes - they are exactly the same between Ubuntu 12.04 and in the incorrectly displayed 12.10 version.
- item-padding
- row-spacing
- column-spacing
- item-width
This display behaviour occurs immediately when I set either the text_column or the markup_column (the text under the icons) to be a visible column i.e. changing the value from -1 to the column number.
If the text column/markup column is hidden (i.e. a value of -1) then the display is correct on all distro's.
Since its the same code running on exactly the same music collection - I can only surmise that the newer GTK libraries in Fedora 17/Ubuntu 12.10/13.04 are behaving differently.
My google-fu has only found this reference which sounds identical. However examining the ubuntu-accomplishment-viewer source code hasnt really enlightened me.
Has anybody else encountered this? Any suggestions on the best way to investigate further?
Ok - I've tried to reduce this to the bare essentials - this simple glade file with this simple code produces this issue. However I'm still non-the-wiser what is causing this visual effect :/
#!/usr/bin/env python from gi.repository import Gtk, GdkPixbuf window = Gtk.Window() window.connect('delete_event', Gtk.main_quit) ui = Gtk.Builder() ui.add_from_file('reproduce.ui') page = ui.get_object('main_box') window.add(page) ls = Gtk.ListStore(str, GdkPixbuf.Pixbuf) icon = GdkPixbuf.Pixbuf.new_from_file_at_size( str("/usr/share/icons/gnome/48x48/actions/zoom-out.png"), 90, 90) for i in range(15): ls.append(['Item %d' % i, icon]) covers_view = ui.get_object('covers_view') covers_view.set_model(ls) covers_view.set_text_column(0) covers_view.set_pixbuf_column(1) covers_view.set_item_width(100) # These lines make it easier to see the problem crt, crp = covers_view.get_cells() crt.set_property('background', '#000') crt.set_property('foreground', '#AAA') print crt.get_request_mode() window.set_default_size(600,400) window.show_all() Gtk.main()
and the glade - http://pastebin.com/uvQ9mWeg
From a suggestion by deinonychusaur I looked at gtkparasite
FYI - I used the ready made PPA from AnthonyWong for both Ubuntu 12.04 and 12.10.
The results for both versions were identical. Experimenting changing the IconView properties using the apps did not really resolve this.
The next suggestion from deinonychusaur looks very interesting and I can confirm - i.e.
The IconView CellRendererText is 2x the size of the IconView Pixbuf in Fedora 17/12.10/13.04 but 1x the size of the IconView Pixbuf in 12.04.
CellRendererText
has a preferred width of 180 and if set to 100, this value is changed atwindow.show_all()
to 180 again. And even if changed back after everything is shown, it still gets changed to 180 duringGtk.main()
. (If will in fact set itself to 2x width of theCellRendererPixbuf
which can be seen if that one is changed to 100 instead of 90, causing theCellRendererText
to become 200) – TittleCellAreaBox
that holds the two renderers (if its orientation is switched to horizontal, the issue remains). That is, it is not a packing + expand issue. – TittleCellRendererText
is visible. Also, if you check the print-statement it says<enum GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH of type GtkSizeRequestMode>
, which may be the related to the problem? There's aGtk.SizeRequestMode.CONSTANT_SIZE
, but I don't know how to change it. – Tittle