From 86b63298a5925740634efba105f87782c3cc2947 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Mon, 4 Jul 2016 20:06:11 -0400 Subject: [PATCH] gui/idle: Show the idle progress as a tooltip Signed-off-by: Anna Schumaker --- CHANGELOG | 1 + gui/idle.c | 6 ++++++ share/ocarina/ocarina6.glade | 1 + 3 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index e4aad629..a5c5477b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,5 @@ 6.4.14: +- Add idle progress as a tooltip. - Initialize track labels with the correct initial size - Initialize album part with the correct size - Gui spacing updates diff --git a/gui/idle.c b/gui/idle.c index 3b053024..9af98a8a 100644 --- a/gui/idle.c +++ b/gui/idle.c @@ -10,9 +10,15 @@ static guint idle_id = 0; static gboolean __on_idle(gpointer data) { GtkProgressBar *progress = GTK_PROGRESS_BAR(data); + unsigned int percent = idle_progress() * 100; + gchar *text; if (idle_run_task()) { gtk_progress_bar_set_fraction(progress, idle_progress()); + + text = g_strdup_printf("%u%%", percent); + gtk_widget_set_tooltip_text(GTK_WIDGET(progress), text); + g_free(text); return G_SOURCE_CONTINUE; } else { gtk_widget_hide(GTK_WIDGET(progress)); diff --git a/share/ocarina/ocarina6.glade b/share/ocarina/ocarina6.glade index 17cc5563..555386a4 100644 --- a/share/ocarina/ocarina6.glade +++ b/share/ocarina/ocarina6.glade @@ -1391,6 +1391,7 @@ False + 0% start center 2