From bf39c221b81c7b23b9d786e7fe686aae15fb2966 Mon Sep 17 00:00:00 2001 From: Luca Bacci <luca.bacci982@gmail.com> Date: Tue, 22 Jan 2019 14:51:37 +0100 Subject: [PATCH 24/26] Enable display of progress bar text when applying operations (#7) In Gtk2 progress bars show optional text superimposed over the bar. In Gtk3 the text is not displayed by default, so set the show-text property to re-enable this [1]. Also note that since Gtk 3.14.0 the optional text is not superimposed over the progress bar, but instead displayed just above it [2][3][4]. References: [1] Gtkmm 3.0 Gtk::ProgressBar Class Reference, set_show_text() "Sets whether the progressbar will show text superimposed over the bar." https://developer.gnome.org/gtkmm/3.0/classGtk_1_1ProgressBar.html#a0bfa6042f5d4b3509967abc2d8af57fe [2] Commit - Update the design for progress bars https://gitlab.gnome.org/GNOME/gtk/commit/74405cc964e405ea00cfac22856a62fea5ec648e [3] Bug 748784 - GtkProgressBar text cannot be superimposed on the progress bar https://bugzilla.gnome.org/show_bug.cgi?id=748784 [4] Gtkmm 3.18 Gtk:ProgressBar Class Reference, set_show_text() "Set whether the progress bar will show text next to the bar." https://developer.gnome.org/gtkmm/3.18/classGtk_1_1ProgressBar.html#a0bfa6042f5d4b3509967abc2d8af57fe Closes #7 - Port to Gtk3 --- src/Dialog_Progress.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Dialog_Progress.cc b/src/Dialog_Progress.cc index b3b25218..a9d46bd7 100644 --- a/src/Dialog_Progress.cc +++ b/src/Dialog_Progress.cc @@ -54,6 +54,7 @@ Dialog_Progress::Dialog_Progress( const std::vector<Operation *> & operations ) vbox->pack_start(label_current, Gtk::PACK_SHRINK); progressbar_current.set_pulse_step(0.01); + progressbar_current.set_show_text(); vbox->pack_start(progressbar_current, Gtk::PACK_SHRINK); label_current_sub.set_alignment(Gtk::ALIGN_START); @@ -61,6 +62,8 @@ Dialog_Progress::Dialog_Progress( const std::vector<Operation *> & operations ) vbox->pack_start(*Utils::mk_label("<b>" + Glib::ustring(_("Completed Operations:")) + "</b>"), Gtk::PACK_SHRINK); + + progressbar_all.set_show_text(); vbox->pack_start(progressbar_all, Gtk::PACK_SHRINK); //create some icons here, instead of recreating them every time -- 2.21.0