Our Source List widget does not use GtkTreeView's built-in expander and indentation system. I can confirm that the spacing issues are a problem in GtkTreeView, which doesn't make it the ideal base widget for building sidebars, but I guess we have no choice.
What I did to solve the problem in Granite's SourceList was packing multible invisible cell renderers at the beginning of the TreeViewColumn and making them visible or invisible depending on whether we want them to add padding or not; this is basically our indentation system. Since this implied disabling GtkTreeView's built-in expanders, I also had to write an expander cell renderer and pack the expander cells manually into the TreeViewColumn.
I am somewhat familiar with the codebase of your Sidebar widget, so I could add this feature if you think that the solution is not too hacky for Yorba's taste.
Jim,
Here is how we attacked the problem in Granite.
Our Source List widget does not use GtkTreeView's built-in expander and indentation system. I can confirm that the spacing issues are a problem in GtkTreeView, which doesn't make it the ideal base widget for building sidebars, but I guess we have no choice.
What I did to solve the problem in Granite's SourceList was packing multible invisible cell renderers at the beginning of the TreeViewColumn and making them visible or invisible depending on whether we want them to add padding or not; this is basically our indentation system. Since this implied disabling GtkTreeView's built-in expanders, I also had to write an expander cell renderer and pack the expander cells manually into the TreeViewColumn.
I am somewhat familiar with the codebase of your Sidebar widget, so I could add this feature if you think that the solution is not too hacky for Yorba's taste.
The relevant parts of our code are:
1. LEVEL-INDENTATION REPLACEMENT:
1.1 Invisible cell renderer that only adds space: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ SourceList. vala#L1124
1.2 Spacing properties: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ SourceList. vala#L1215
1.3 Deactivate built-in expanders and indentation: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ SourceList. vala#L1253
1.4 Putting the first stone in: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ SourceList. vala#L1318
1.5 Code that controls what spacers become visible: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ SourceList. vala#L1805
2. EXPANDER SYSTEM:
2.1 Packing the expanders: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ SourceList. vala#L1262
2.2 Expander visibility controller: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ SourceList. vala#L1896
2.3 Hacky button-press-event handler that captures clicks on the expanders and avoids selecting the cells if that's the case: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ SourceList. vala#L1612
2.4 Expander renderer: http:// bazaar. launchpad. net/~elementary -pantheon/ granite/ granite/ view/head: /lib/Widgets/ CellRendererExp ander.vala
I hope this information is helpful.