gui/idle: Show the idle progress as a tooltip
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
3c9798a6b7
commit
86b63298a5
|
@ -1,4 +1,5 @@
|
||||||
6.4.14:
|
6.4.14:
|
||||||
|
- Add idle progress as a tooltip.
|
||||||
- Initialize track labels with the correct initial size
|
- Initialize track labels with the correct initial size
|
||||||
- Initialize album part with the correct size
|
- Initialize album part with the correct size
|
||||||
- Gui spacing updates
|
- Gui spacing updates
|
||||||
|
|
|
@ -10,9 +10,15 @@ static guint idle_id = 0;
|
||||||
static gboolean __on_idle(gpointer data)
|
static gboolean __on_idle(gpointer data)
|
||||||
{
|
{
|
||||||
GtkProgressBar *progress = GTK_PROGRESS_BAR(data);
|
GtkProgressBar *progress = GTK_PROGRESS_BAR(data);
|
||||||
|
unsigned int percent = idle_progress() * 100;
|
||||||
|
gchar *text;
|
||||||
|
|
||||||
if (idle_run_task()) {
|
if (idle_run_task()) {
|
||||||
gtk_progress_bar_set_fraction(progress, idle_progress());
|
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;
|
return G_SOURCE_CONTINUE;
|
||||||
} else {
|
} else {
|
||||||
gtk_widget_hide(GTK_WIDGET(progress));
|
gtk_widget_hide(GTK_WIDGET(progress));
|
||||||
|
|
|
@ -1391,6 +1391,7 @@
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkProgressBar" id="o_idle_progress">
|
<object class="GtkProgressBar" id="o_idle_progress">
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
|
<property name="tooltip_text" translatable="yes">0%</property>
|
||||||
<property name="halign">start</property>
|
<property name="halign">start</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="margin_top">2</property>
|
<property name="margin_top">2</property>
|
||||||
|
|
Loading…
Reference in New Issue