Skip to content

GtkTreeExpander: indent-without-expander property

A patch to implement #4175 (closed)

This implements a new property or GtkTreeExpander called indent-without-expander with default value TRUE to not change default behavior. The use-case is to implement a list-view where rows without an expander-icon have a similar sized icon instead (a favicon in this case). This way the labels are still aligned and the indention from category->feed is not strangely large.

Screenshot_from_2021-08-18_20-29-11_

Here is a comparison with the Gtk4 demo app:

Untitled

Naming and documentation of the property was a bit hard for me as a non-native speaker since the widget is called "TreeExpander" and the icon itself is called "expander". So it's hard to always clearly distinguish the two while also keeping things short and to the point.

@otte: I didn't quite understand what you meant with

GtkTreeExpander:indent-depth
If this was set to false, set depth=0 in https://gitlab.gnome.org/GNOME/gtk/-/blob/19b534f7de7298ae76b173b69e7855ed84a0eb09/gtk/gtktreeexpander.c#L163

This would make the tree completely flat. And I'm not sure if that is useful to anyone. At least to me it wouldn't be.

This is my first attempt to contribute to Gtk and my first C code in quite some while. I tried to follow all the conventions I could make out. Please be patient if I missed something.

Merge request reports