Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #19 from anaselli/master
Added percentage to YGProgressBar (same behavior as ncurses and qt implementation)
  • Loading branch information
tgoettlicher committed Dec 28, 2012
2 parents 9c1990b + 02ad5ac commit 3fd2176
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ChangeLog
@@ -1,7 +1,9 @@
-------------------------------------------------------------------
Thu Dec 27 14:49:28 CET 2012 - anaselli@linux.it
Thu Dec 27 21:45:30 CET 2012 - anaselli@linux.it

- Fixed YGProgressBar setValue to refresh
- Added percentage to YGProgressBar (same behavior of ncurses and
qt implementation)

-------------------------------------------------------------------
Fri Nov 2 19:19:27 CET 2012 - anaselli@linux.it
Expand Down
7 changes: 4 additions & 3 deletions src/YGProgressBar.cc
Expand Up @@ -56,12 +56,13 @@ class YGProgressBar : public YProgressBar, public YGLabeledWidget
GtkProgressBar *bar = GTK_PROGRESS_BAR (getWidget());
float fraction = CLAMP ((float) value / maxValue(), 0, 1);
gtk_progress_bar_set_fraction (bar, fraction);
gtk_main_iteration_do(false);
/*

char *text = g_strdup_printf ("%d %%", (int) (fraction*100));
gtk_progress_bar_set_text (bar, text);
g_free (text);
*/
gtk_progress_bar_set_show_text(bar, true);

gtk_main_iteration_do(false);
}

virtual unsigned int getMinSize (YUIDimension dim)
Expand Down

0 comments on commit 3fd2176

Please sign in to comment.