gui/idle: Show the idle progress as a tooltip

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-07-04 20:06:11 -04:00
parent 3c9798a6b7
commit 86b63298a5
3 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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));

View File

@ -1391,6 +1391,7 @@
<child>
<object class="GtkProgressBar" id="o_idle_progress">
<property name="can_focus">False</property>
<property name="tooltip_text" translatable="yes">0%</property>
<property name="halign">start</property>
<property name="valign">center</property>
<property name="margin_top">2</property>