Improve the rendering of progress bars with Gtk+ 3

This commit is contained in:
Pierre Pronchery 2018-01-25 20:17:06 +01:00
parent 21ddfb3461
commit b92cbe8b69
2 changed files with 5 additions and 0 deletions

View File

@ -558,6 +558,10 @@ static void _download_refresh(Download * download)
snprintf(buf, sizeof(buf), "%.1f%%", total_fraction * 100);
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
download->progress), total_fraction);
#if GTK_CHECK_VERSION(3, 0, 0)
gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(
download->progress), TRUE);
#endif
_refresh_remaining(download, rate);
}
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(download->progress), buf);

View File

@ -443,6 +443,7 @@ Surfer * _new_do(char const * url)
gtk_box_pack_start(GTK_BOX(surfer->statusbox), widget, FALSE, TRUE, 0);
#if !GTK_CHECK_VERSION(2, 16, 0)
surfer->progress = gtk_progress_bar_new();
gtk_progress_bar_set_text(GTK_PROGRESS(surfer->progress), "");
gtk_box_pack_start(GTK_BOX(surfer->statusbox), surfer->progress, FALSE,
FALSE, 0);
#endif