From d346b8e42923c7428a6521b4fc575c6086457d7e Mon Sep 17 00:00:00 2001 From: Nikita Zlobin Date: Fri, 13 May 2011 20:20:53 +0600 Subject: [PATCH] Fix: Set port height to minimum, necessary for text --- src/gtkgraph-demo.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gtkgraph-demo.c b/src/gtkgraph-demo.c index 431d349..a0c90e8 100644 --- a/src/gtkgraph-demo.c +++ b/src/gtkgraph-demo.c @@ -213,8 +213,6 @@ text_wanted_size (GooCanvasItem * item, double * w, double * h) static double ports_group_update_width (GModularGraphPortsGroup * group) { - g_print ("ports_group_update_width\n"); - double min_width = 0; GList * sib = group->ports; @@ -262,7 +260,7 @@ void g_modular_graph_module_add_port (GModularGraph_Port ** ret, /* Decoration */ port->box = goo_canvas_rect_new (group->container, - 0.5, 0.5, 50, 15, + 0.5, 0.5, 50, 5, "tooltip", tooltip, "radius-x", rounding, "radius-y", rounding, @@ -480,12 +478,13 @@ static gboolean on_module_text_notify (GooCanvasItem * item, GParamSpec * event, static gboolean on_port_text_notify (GooCanvasItem * item, GParamSpec * event, gpointer data) { - double w; - text_wanted_size (item, &w, NULL); + double w, h; + text_wanted_size (item, &w, &h); if (G_MODULAR_GRAPH_PORT (data)->min_width == w) return FALSE; G_MODULAR_GRAPH_PORT (data)->min_width = w; ports_group_update_width (G_MODULAR_GRAPH_PORT (data)->ports_group); + g_object_set (G_MODULAR_GRAPH_PORT (data)->box, "height", h, NULL); return FALSE; } -- 2.11.4.GIT