[gtk+] entry: Make progress node invisible when appropriate



commit 6b2cde94b4191ab7cf3f84b3ad13978f79431c6d
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Mar 4 08:01:02 2016 -0500

    entry: Make progress node invisible when appropriate
    
    We were failing to do that, leading to progress not disappearing
    anymore after it was initially shown, in the gtk3-widget-factory
    entry progress example.

 gtk/gtkentry.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 983eb8c..a2ec505 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -10547,7 +10547,6 @@ gtk_entry_set_progress_fraction (GtkEntry *entry,
   gtk_entry_stop_pulse_mode (entry);
 
   gtk_entry_ensure_progress_gadget (entry);
-  gtk_css_gadget_set_visible (private->progress_gadget, TRUE);
 
   fraction = CLAMP (fraction, 0.0, 1.0);
   private->progress_fraction = fraction;
@@ -10555,6 +10554,8 @@ gtk_entry_set_progress_fraction (GtkEntry *entry,
 
   if (fraction != old_fraction)
     {
+      gtk_css_gadget_set_visible (private->progress_gadget, fraction > 0);
+
       g_object_notify_by_pspec (G_OBJECT (entry), entry_props[PROP_PROGRESS_FRACTION]);
       gtk_widget_queue_allocate (widget);
     }


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