From b6c099c4b931a3dfe2784b4fda793305314ccef9 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Tue, 3 Jul 2018 19:40:42 +0200 Subject: [PATCH] app: fix width of GimpThumbBox' thumbnail generation progressbar using CSS and GTK_ALIGN_FILL. The progress is currently not visible, there is a bug in Adwaita that is about to be fixed upstream. --- app/widgets/gimpfiledialog.c | 2 ++ app/widgets/gimpthumbbox.c | 11 ++++++----- themes/System/gimp.css | 6 ++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/widgets/gimpfiledialog.c b/app/widgets/gimpfiledialog.c index b72fb490f3..d405864d60 100644 --- a/app/widgets/gimpfiledialog.c +++ b/app/widgets/gimpfiledialog.c @@ -223,6 +223,8 @@ gimp_file_dialog_class_init (GimpFileDialogClass *klass) GIMP_FILE_PROCEDURE_GROUP_NONE, GIMP_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY)); + + gtk_widget_class_set_css_name (widget_class, "GimpFileDialog"); } static void diff --git a/app/widgets/gimpthumbbox.c b/app/widgets/gimpthumbbox.c index 822c6ecffa..0a27f47419 100644 --- a/app/widgets/gimpthumbbox.c +++ b/app/widgets/gimpthumbbox.c @@ -415,9 +415,10 @@ gimp_thumb_box_new (GimpContext *context) gtk_widget_show (box->info); box->progress = gtk_progress_bar_new (); + gtk_widget_set_halign (box->progress, GTK_ALIGN_FILL); + gtk_progress_bar_set_show_text (GTK_PROGRESS_BAR (box->progress), TRUE); gtk_progress_bar_set_text (GTK_PROGRESS_BAR (box->progress), "Fog"); gtk_box_pack_end (GTK_BOX (vbox2), box->progress, FALSE, FALSE, 0); - gtk_widget_set_no_show_all (box->progress, TRUE); /* don't gtk_widget_show (box->progress); */ gtk_widget_set_size_request (GTK_WIDGET (box), @@ -586,8 +587,8 @@ gimp_thumb_box_create_thumbnails (GimpThumbBox *box, gimp_progress_set_value (progress, 0.0); - while (gtk_events_pending ()) - gtk_main_iteration (); + while (g_main_context_pending (NULL)) + g_main_context_iteration (NULL, FALSE); gimp_thumb_box_create_thumbnail (box, list->data, @@ -607,8 +608,8 @@ gimp_thumb_box_create_thumbnails (GimpThumbBox *box, gimp_progress_set_value (progress, 0.0); - while (gtk_events_pending ()) - gtk_main_iteration (); + while (g_main_context_pending (NULL)) + g_main_context_iteration (NULL, FALSE); } if (box->files) diff --git a/themes/System/gimp.css b/themes/System/gimp.css index a6196f5500..b55e12eefe 100644 --- a/themes/System/gimp.css +++ b/themes/System/gimp.css @@ -133,6 +133,12 @@ GimpDisplayShell progressbar progress { min-height: 1em; } +GimpFileDialog progressbar trough, +GimpFileDialog progressbar progress { + min-width: 1px; /* hack */ + min-height: 1em; +} + GimpRuler { font-size: smaller; }