[gitg/vala] Added separator functionality for navigation
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/vala] Added separator functionality for navigation
- Date: Wed, 18 Jul 2012 08:09:00 +0000 (UTC)
commit b767be325d429db6256a32d2a163d94ea8a63667
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Wed Jul 18 10:08:16 2012 +0200
Added separator functionality for navigation
libgitg-ext/gitg-ext-navigation-tree-view.vala | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/libgitg-ext/gitg-ext-navigation-tree-view.vala b/libgitg-ext/gitg-ext-navigation-tree-view.vala
index 806fb00..9b82c4f 100644
--- a/libgitg-ext/gitg-ext-navigation-tree-view.vala
+++ b/libgitg-ext/gitg-ext-navigation-tree-view.vala
@@ -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) => {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]