]> Pileus Git - ~andy/gtk/commitdiff
Reset the animation iter on unrealize as well as unmap. (#94336)
authorOwen Taylor <otaylor@redhat.com>
Fri, 27 Sep 2002 19:54:51 +0000 (19:54 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Fri, 27 Sep 2002 19:54:51 +0000 (19:54 +0000)
Fri Sep 27 15:27:45 2002  Owen Taylor  <otaylor@redhat.com>
        * gtk/gtkimage.c (gtk_image_unrealize): Reset the
        animation iter on unrealize as well as unmap.
        (#94336)

        * gtk/gtkprogressbar.c (gtk_progress_bar_set_text): Don't
        turn a value of "" into NULL. (#94157, Vitaly Tishkov)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkimage.c
gtk/gtkprogressbar.c

index 09e466eaf82e66a6575c409e890da4d12d8f98b7..c25471aab561cf1a0c15bd80d481c8a4dd77fc56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri Sep 27 15:27:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkimage.c (gtk_image_unrealize): Reset the
+       animation iter on unrealize as well as unmap.
+       (#94336)
+
+       * gtk/gtkprogressbar.c (gtk_progress_bar_set_text): Don't
+       turn a value of "" into NULL. (#94157, Vitaly Tishkov)
+
 Wed Sep 25 18:23:50 2002  HideToshi Tajima  <hidetoshi.tajima@sun.com>
 
        * modules/input/gtkimcontextxim.c:
index 09e466eaf82e66a6575c409e890da4d12d8f98b7..c25471aab561cf1a0c15bd80d481c8a4dd77fc56 100644 (file)
@@ -1,3 +1,12 @@
+Fri Sep 27 15:27:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkimage.c (gtk_image_unrealize): Reset the
+       animation iter on unrealize as well as unmap.
+       (#94336)
+
+       * gtk/gtkprogressbar.c (gtk_progress_bar_set_text): Don't
+       turn a value of "" into NULL. (#94157, Vitaly Tishkov)
+
 Wed Sep 25 18:23:50 2002  HideToshi Tajima  <hidetoshi.tajima@sun.com>
 
        * modules/input/gtkimcontextxim.c:
index 09e466eaf82e66a6575c409e890da4d12d8f98b7..c25471aab561cf1a0c15bd80d481c8a4dd77fc56 100644 (file)
@@ -1,3 +1,12 @@
+Fri Sep 27 15:27:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkimage.c (gtk_image_unrealize): Reset the
+       animation iter on unrealize as well as unmap.
+       (#94336)
+
+       * gtk/gtkprogressbar.c (gtk_progress_bar_set_text): Don't
+       turn a value of "" into NULL. (#94157, Vitaly Tishkov)
+
 Wed Sep 25 18:23:50 2002  HideToshi Tajima  <hidetoshi.tajima@sun.com>
 
        * modules/input/gtkimcontextxim.c:
index 09e466eaf82e66a6575c409e890da4d12d8f98b7..c25471aab561cf1a0c15bd80d481c8a4dd77fc56 100644 (file)
@@ -1,3 +1,12 @@
+Fri Sep 27 15:27:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkimage.c (gtk_image_unrealize): Reset the
+       animation iter on unrealize as well as unmap.
+       (#94336)
+
+       * gtk/gtkprogressbar.c (gtk_progress_bar_set_text): Don't
+       turn a value of "" into NULL. (#94157, Vitaly Tishkov)
+
 Wed Sep 25 18:23:50 2002  HideToshi Tajima  <hidetoshi.tajima@sun.com>
 
        * modules/input/gtkimcontextxim.c:
index 09e466eaf82e66a6575c409e890da4d12d8f98b7..c25471aab561cf1a0c15bd80d481c8a4dd77fc56 100644 (file)
@@ -1,3 +1,12 @@
+Fri Sep 27 15:27:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkimage.c (gtk_image_unrealize): Reset the
+       animation iter on unrealize as well as unmap.
+       (#94336)
+
+       * gtk/gtkprogressbar.c (gtk_progress_bar_set_text): Don't
+       turn a value of "" into NULL. (#94157, Vitaly Tishkov)
+
 Wed Sep 25 18:23:50 2002  HideToshi Tajima  <hidetoshi.tajima@sun.com>
 
        * modules/input/gtkimcontextxim.c:
index 09e466eaf82e66a6575c409e890da4d12d8f98b7..c25471aab561cf1a0c15bd80d481c8a4dd77fc56 100644 (file)
@@ -1,3 +1,12 @@
+Fri Sep 27 15:27:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkimage.c (gtk_image_unrealize): Reset the
+       animation iter on unrealize as well as unmap.
+       (#94336)
+
+       * gtk/gtkprogressbar.c (gtk_progress_bar_set_text): Don't
+       turn a value of "" into NULL. (#94157, Vitaly Tishkov)
+
 Wed Sep 25 18:23:50 2002  HideToshi Tajima  <hidetoshi.tajima@sun.com>
 
        * modules/input/gtkimcontextxim.c:
index 967fd29df54000d3fadf964894add9e68fb9c2e7..3ca712b65a8bae163a4733498b4ff62fc25b051f 100644 (file)
@@ -39,6 +39,7 @@ static void gtk_image_init         (GtkImage       *image);
 static gint gtk_image_expose       (GtkWidget      *widget,
                                     GdkEventExpose *event);
 static void gtk_image_unmap        (GtkWidget      *widget);
+static void gtk_image_unrealize    (GtkWidget      *widget);
 static void gtk_image_size_request (GtkWidget      *widget,
                                     GtkRequisition *requisition);
 static void gtk_image_destroy      (GtkObject      *object);
@@ -122,6 +123,7 @@ gtk_image_class_init (GtkImageClass *class)
   widget_class->expose_event = gtk_image_expose;
   widget_class->size_request = gtk_image_size_request;
   widget_class->unmap = gtk_image_unmap;
+  widget_class->unrealize = gtk_image_unrealize;
   
   g_object_class_install_property (gobject_class,
                                    PROP_PIXBUF,
@@ -1136,12 +1138,8 @@ gtk_image_get (GtkImage   *image,
 }
 
 static void
-gtk_image_unmap (GtkWidget *widget)
+gtk_image_reset_anim_iter (GtkImage *image)
 {
-  GtkImage *image;
-
-  image = GTK_IMAGE (widget);
-
   if (image->storage_type == GTK_IMAGE_ANIMATION)
     {
       /* Reset the animation */
@@ -1158,11 +1156,26 @@ gtk_image_unmap (GtkWidget *widget)
           image->data.anim.iter = NULL;
         }
     }
+}
+
+static void
+gtk_image_unmap (GtkWidget *widget)
+{
+  gtk_image_reset_anim_iter (GTK_IMAGE (widget));
 
   if (GTK_WIDGET_CLASS (parent_class)->unmap)
     GTK_WIDGET_CLASS (parent_class)->unmap (widget);
 }
 
+static void
+gtk_image_unrealize (GtkWidget *widget)
+{
+  gtk_image_reset_anim_iter (GTK_IMAGE (widget));
+
+  if (GTK_WIDGET_CLASS (parent_class)->unrealize)
+    GTK_WIDGET_CLASS (parent_class)->unrealize (widget);
+}
+
 static gint
 animation_timeout (gpointer data)
 {
index e5ac4eeb31595a0c937aa5d4a81b4f1aad6d10b8..4d5f80d79e746a81ab0f11de50204c787659df55 100644 (file)
@@ -910,17 +910,9 @@ gtk_progress_bar_set_text (GtkProgressBar *pbar,
 {
   g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
   
-  if (text && *text)
-    {
-      gtk_progress_set_show_text (GTK_PROGRESS (pbar), TRUE);
-      gtk_progress_set_format_string (GTK_PROGRESS (pbar), text);
-    }
-  else
-    {
-      gtk_progress_set_show_text (GTK_PROGRESS (pbar), FALSE);
-      gtk_progress_set_format_string (GTK_PROGRESS (pbar), NULL);
-    }
-
+  gtk_progress_set_show_text (GTK_PROGRESS (pbar), text && *text);
+  gtk_progress_set_format_string (GTK_PROGRESS (pbar), text);
+  
   /* We don't support formats in this interface */
   GTK_PROGRESS (pbar)->use_text_format = FALSE;