[libdazzle] tree: queue draw on the tree when changing emblems
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] tree: queue draw on the tree when changing emblems
- Date: Sat, 9 Dec 2017 10:15:25 +0000 (UTC)
commit f8483d2108a48419faf8b1637b26da080ca28f82
Author: Christian Hergert <chergert redhat com>
Date: Sat Dec 9 02:14:28 2017 -0800
tree: queue draw on the tree when changing emblems
Pretty straight forward, we need to ensure the tree is redrawn when
these are changed (as they can be done out-of-band).
src/tree/dzl-tree-node.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/tree/dzl-tree-node.c b/src/tree/dzl-tree-node.c
index 832720d..7f033aa 100644
--- a/src/tree/dzl-tree-node.c
+++ b/src/tree/dzl-tree-node.c
@@ -268,6 +268,15 @@ dzl_tree_node_get_parent (DzlTreeNode *node)
return node->parent;
}
+static void
+dzl_tree_node_queue_draw (DzlTreeNode *self)
+{
+ g_assert (DZL_IS_TREE_NODE (self));
+
+ if (self->tree != NULL)
+ gtk_widget_queue_draw (GTK_WIDGET (self->tree));
+}
+
void
dzl_tree_node_set_gicon (DzlTreeNode *self,
GIcon *gicon)
@@ -360,6 +369,7 @@ dzl_tree_node_set_icon_name (DzlTreeNode *node,
g_clear_object (&node->gicon);
g_object_notify_by_pspec (G_OBJECT (node), properties [PROP_ICON_NAME]);
g_object_notify_by_pspec (G_OBJECT (node), properties [PROP_GICON]);
+ dzl_tree_node_queue_draw (node);
}
}
@@ -389,6 +399,7 @@ dzl_tree_node_add_emblem (DzlTreeNode *self,
self->emblems = g_list_prepend (self->emblems, g_strdup (emblem));
g_clear_object (&self->gicon);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_GICON]);
+ dzl_tree_node_queue_draw (self);
}
void
@@ -407,6 +418,7 @@ dzl_tree_node_remove_emblem (DzlTreeNode *self,
self->emblems = g_list_delete_link (self->emblems, iter);
g_clear_object (&self->gicon);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_GICON]);
+ dzl_tree_node_queue_draw (self);
return;
}
}
@@ -426,6 +438,7 @@ dzl_tree_node_clear_emblems (DzlTreeNode *self)
self->emblems = NULL;
g_clear_object (&self->gicon);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_GICON]);
+ dzl_tree_node_queue_draw (self);
}
/**
@@ -476,6 +489,7 @@ dzl_tree_node_set_emblems (DzlTreeNode *self,
g_clear_object (&self->gicon);
g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_GICON]);
+ dzl_tree_node_queue_draw (self);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]