Added separator functionality for navigation

This commit is contained in:
Jesse van den Kieboom 2012-07-18 10:08:16 +02:00
parent eff97b8a12
commit b767be325d

View file

@ -33,7 +33,8 @@ private enum Hint
{
NONE,
HEADER,
DEFAULT
DEFAULT,
SEPARATOR
}
public delegate void NavigationActivated(int numclick);
@ -149,6 +150,14 @@ public class NavigationTreeModel : Gtk.TreeStore
return this;
}
public new NavigationTreeModel separator()
{
Gtk.TreeIter iter;
append_one("", null, Hint.SEPARATOR, null, out iter);
return this;
}
public uint populate(GitgExt.Navigation? nav)
{
if (nav == null)
@ -411,6 +420,13 @@ public class NavigationTreeView : Gtk.TreeView
}
});
set_row_separator_func((model, iter) => {
Hint hint;
model.get(iter, Column.HINT, out hint);
return hint == Hint.SEPARATOR;
});
append_column(col);
get_selection().set_select_function((sel, model, path, cursel) => {