Skip to content
Snippets Groups Projects
Commit 771c2ef3 authored by Bruce Cowan's avatar Bruce Cowan
Browse files

Better tooltip (closes #4)

Still does things like '1 tries' though
parent 3204698f
No related branches found
No related tags found
No related merge requests found
......@@ -100,15 +100,25 @@ populate_store_foreach (gpointer data,
gint utries = possiblity->utries;
gint kicks = possiblity->kicks;
g_autofree gchar *tooltip = g_strdup_printf ("%d tries, %d converted, %d kicks",
tries, utries, kicks);
g_autoptr (GString) string = g_string_new (NULL);
if (tries > 0 || utries > 0)
g_string_append_printf (string, "%d tries, %d converted",
tries + utries, tries);
if (kicks > 0)
{
if (string->len == 0)
g_string_append_printf (string, "%d kicks", kicks);
else
g_string_append_printf (string, ", %d kicks", kicks);
}
gtk_list_store_append (store, &iter);
gtk_list_store_set (store, &iter,
RUGBY_SCORE_STORE_TRIES, tries,
RUGBY_SCORE_STORE_UTRIES, utries,
RUGBY_SCORE_STORE_KICKS, kicks,
RUGBY_SCORE_STORE_TOOLTIP, tooltip,
RUGBY_SCORE_STORE_TOOLTIP, string->str,
-1);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment