mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-09-13 13:11:42 +00:00
Added separator functionality for navigation
This commit is contained in:
parent
eff97b8a12
commit
b767be325d
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue