[giv] Reflect the $hide state in the marks browser.
- From: Dov Grobgeld <dov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [giv] Reflect the $hide state in the marks browser.
- Date: Fri, 8 Jun 2012 12:36:42 +0000 (UTC)
commit 0a37c1e5b8eab2924972df00352a011be1aaa069
Author: Dov Grobgeld <dov grobgeld gmail com>
Date: Thu Jun 7 22:38:31 2012 +0300
Reflect the $hide state in the marks browser.
examples/hidden.giv | 12 ++++++++++++
src/giv-mark-tree-dialog.gob | 7 +++++--
2 files changed, 17 insertions(+), 2 deletions(-)
---
diff --git a/examples/hidden.giv b/examples/hidden.giv
new file mode 100644
index 0000000..a8b270f
--- /dev/null
+++ b/examples/hidden.giv
@@ -0,0 +1,12 @@
+# Test the hidden features
+$color red
+$hide
+$marks fcircle
+0 0
+100 100
+
+$color green
+$mark fcircle
+$marks fcircle
+0 100
+100 0
diff --git a/src/giv-mark-tree-dialog.gob b/src/giv-mark-tree-dialog.gob
index bb22e65..50b00b3 100644
--- a/src/giv-mark-tree-dialog.gob
+++ b/src/giv-mark-tree-dialog.gob
@@ -97,6 +97,7 @@ class Giv:Mark:Tree:Dialog from Gtk:Dialog {
gtk_tree_view_column_set_attributes (column, cell,
"active", 1,
NULL);
+
/* gtk_tree_view_column_set_resizable(column, TRUE); */
gtk_tree_view_column_set_title (column, "Visible");
gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), column);
@@ -136,12 +137,15 @@ class Giv:Mark:Tree:Dialog from Gtk:Dialog {
get_iter_from_mark_set(self, mark_set, selfp->model,
&iter);
+ // Whether the mark set is originally visible
+ gtk_tree_store_set (selfp->model, iter, 1, mark_set->is_visible, -1);
+
/* This is a very ugly way of summing up the value with that of the
previous columns. That are currently stored in user_data2 of
the iterators.
*/
*((int*)&iter->user_data2) += mark_set->points->len;
-
+
gtk_tree_store_set(selfp->model, iter,
2, (intptr_t)iter->user_data2,
-1);
@@ -360,7 +364,6 @@ static void set_state_tree_node_children(GtkTreeModel *model,
for (int i=0; i<n_children; i++)
{
GtkTreeIter iter;
- gboolean value;
gtk_tree_model_iter_nth_child(model,
&iter,
parent_iter,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]