[graph-gtk] Selecting a node moves it to the top of the visual node stack, and when selecting, the top-most node
- From: Isaac Wagner <isaacbw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [graph-gtk] Selecting a node moves it to the top of the visual node stack, and when selecting, the top-most node
- Date: Tue, 31 Jul 2012 11:22:24 +0000 (UTC)
commit 62d31d6af1759e062bda989de43fdc419c980cd9
Author: Isaac Wagner <isaacbw src gnome org>
Date: Tue Jul 31 07:21:40 2012 -0400
Selecting a node moves it to the top of the visual node stack, and when selecting, the top-most node will be selected
graph-gtk/graph-gtk-view.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/graph-gtk/graph-gtk-view.c b/graph-gtk/graph-gtk-view.c
index 5efb6cb..91130ff 100644
--- a/graph-gtk/graph-gtk-view.c
+++ b/graph-gtk/graph-gtk-view.c
@@ -264,7 +264,7 @@ graph_gtk_view_button_pressed(GtkWidget* widget, GdkEventButton* event)
self->selected_nodes = NULL;
GList *select = NULL;
- for(nodes = self->nodes; nodes != NULL; nodes = nodes->next)
+ for(nodes = g_list_last(self->nodes); nodes != NULL; nodes = nodes->prev)
{
GraphGtkNode *node = (GraphGtkNode*)nodes->data;
GraphGtkPad *pad;
@@ -303,6 +303,12 @@ graph_gtk_view_button_pressed(GtkWidget* widget, GdkEventButton* event)
GraphGtkNode *node = nodes->data;
g_signal_emit_by_name(widget, "node-selected", GRAPH_GTK_NODE(node));
+ if(g_list_find(self->nodes, node))
+ {
+ self->nodes = g_list_remove(self->nodes, node);
+ self->nodes = g_list_append(self->nodes, node);
+ }
+
if(!nodes->next && event->type == GDK_2BUTTON_PRESS)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]