[easytag] Show progress bar text with GTK+ 3



commit b22129be5b931dccef89457bb2ab963a2c7057e3
Author: David King <amigadave amigadave com>
Date:   Mon Mar 31 16:49:14 2014 +0100

    Show progress bar text with GTK+ 3

 src/bar.c         |    3 ++-
 src/gtk2_compat.c |   15 +++++++++++++++
 src/gtk2_compat.h |    2 ++
 3 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/bar.c b/src/bar.c
index 262684f..5b88033 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -35,6 +35,7 @@
 #include "misc.h"
 #include "charset.h"
 #include "ui_manager.h"
+#include "gtk2_compat.h"
 
 /***************
  * Declaration *
@@ -637,7 +638,7 @@ et_statusbar_pop_tooltip (void)
  */
 GtkWidget *Create_Progress_Bar (void)
 {
-    ProgressBar = gtk_progress_bar_new();
+    ProgressBar = et_progress_bar_new ();
 
     gtk_widget_show(ProgressBar);
     return ProgressBar;
diff --git a/src/gtk2_compat.c b/src/gtk2_compat.c
index f4cc8aa..0f416d5 100644
--- a/src/gtk2_compat.c
+++ b/src/gtk2_compat.c
@@ -101,3 +101,18 @@ void et_grid_attach_margins (GtkGrid *grid, GtkWidget *child, gint left,
     et_grid_attach_full (grid, child, left, top, width, height, FALSE, FALSE,
                          hmargin, vmargin);
 }
+
+GtkWidget *
+et_progress_bar_new (void)
+{
+    GtkWidget *progress;
+
+    progress = gtk_progress_bar_new ();
+
+#if GTK_CHECK_VERSION(3,0,0)
+    gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (progress), TRUE);
+    gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progress), "");
+#endif
+
+    return progress;
+}
diff --git a/src/gtk2_compat.h b/src/gtk2_compat.h
index e089d7b..382e2dd 100644
--- a/src/gtk2_compat.h
+++ b/src/gtk2_compat.h
@@ -57,6 +57,8 @@ void et_grid_attach_margins (GtkGrid *grid, GtkWidget *child, gint left,
                              gint top, gint width, gint height, gint hmargin,
                              gint vmargin);
 
+GtkWidget * et_progress_bar_new (void);
+
 G_END_DECLS
 
 #endif /* GTK2_COMPAT_H_ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]