[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_1_1_1-81-g4ffa495

Philippe Delorme nobody at users.sourceforge.net
Sun Jan 20 14:37:02 CET 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  4ffa4954328b5090e4c8a31d3f16677250873ce1 (commit)
      from  42c7b76b5f362fd6399c036160dd3e38ea95e2fd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4ffa4954328b5090e4c8a31d3f16677250873ce1
Author: Philippe Delorme <philippedelorme at users.sourceforge.net>
Date:   Sun Jan 20 14:35:20 2013 +0100

    Markup and simplification for bet graph tooltips

-----------------------------------------------------------------------

Changes:
diff --git a/src/bet_graph.c b/src/bet_graph.c
index 3de8aaf..f84f7a4 100644
--- a/src/bet_graph.c
+++ b/src/bet_graph.c
@@ -641,9 +641,7 @@ static gboolean bet_graph_on_motion ( GtkWidget *event_box,
     if ( strcmp ( self->service_id, "GogBarColPlot" ) == 0 )
     {
         index = gog_plot_view_get_data_at_point ( GOG_PLOT_VIEW ( view ), event->x, event->y, &series );
-        if ( index == -1 )
-            buf = NULL;
-        else
+        if ( index != -1 )
         {
             double const *x;
             double const *y;
@@ -685,37 +683,29 @@ static gboolean bet_graph_on_motion ( GtkWidget *event_box,
                         utils_real_get_string_with_currency_from_double (
                         self->tab_Y[index-1], self->currency_number ) );
         }
-        else
-            buf = NULL;
         gog_chart_map_free ( map );
     }
     else if (  strcmp ( self->service_id, "GogPiePlot" ) == 0 )
     {
         index = gog_plot_view_get_data_at_point ( GOG_PLOT_VIEW ( view ), event->x, event->y, &series );
-        if ( index == -1 )
-            buf = NULL;
-        else
+        if ( index != -1 )
         {
             double const *x;
             double const *y;
 
             gog_series_get_xy_data ( series, &x, &y );
-            buf = g_strdup_printf ("%s : %s (%.2f%%)", self->tab_vue_libelle[index],
-                        utils_real_get_string_with_currency_from_double (
-                        y[index], self->currency_number ),
-                        ( 100*y[index]/self->montant ) );
+            buf = g_strdup_printf (
+                    "<markup><span font_weight=\"bold\">%s</span>\n%s (%.2f%%)</markup>",
+                    self->tab_vue_libelle[index],
+                    utils_real_get_string_with_currency_from_double ( y[index], self->currency_number ),
+                    100*y[index]/self->montant
+                    );
         }
     }
 
-    if ( buf )
-    {
-        gtk_widget_set_tooltip_text ( GTK_WIDGET ( self->widget ), buf );
-        g_free ( buf );
-    }
-    else
-        gtk_widget_set_tooltip_text ( GTK_WIDGET ( self->widget ), "" );
+    gtk_widget_set_tooltip_markup ( GTK_WIDGET ( self->widget ), buf );
+    g_free ( buf );
 
-    /* return value */
     return TRUE;
 }
 


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list