]> Pileus Git - ~andy/gtk/commitdiff
Always queue a resize ... we rely on the size-allocate to do the update,
authorOwen Taylor <otaylor@redhat.com>
Wed, 21 May 2003 21:23:35 +0000 (21:23 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Wed, 21 May 2003 21:23:35 +0000 (21:23 +0000)
Wed May 21 15:53:14 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkprogress.c (gtk_progress_set_format_string,
        gtk_progress_set_show_text): Always queue a resize ...
        we rely on the size-allocate to do the update, plus a
        different format can actually change our size requisition.
        (#111052)

        * gtk/gtkprogress.c (gtk_progress_changed): Track
        ::changed as well as ::value_changed, and queue a
        resize on ::changed when necessary.

        * gtk/gtkprogress.c (gtk_progress_set_adjustment):
        Call gtk_progress_changed() here to update or
        queue a resize as necessary.

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

index c30a6106cefbcd7434435376c2ef0caa09ed4ae9..dda437ed6a924f62ccf52c54465d86b0b844a0a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,23 @@
+Wed May 21 15:53:14 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkprogress.c (gtk_progress_set_format_string,
+       gtk_progress_set_show_text): Always queue a resize ... 
+       we rely on the size-allocate to do the update, plus a 
+       different format can actually change our size requisition.
+       (#111052)
+
+       * gtk/gtkprogress.c (gtk_progress_changed): Track
+       ::changed as well as ::value_changed, and queue a
+       resize on ::changed when necessary.
+
+       * gtk/gtkprogress.c (gtk_progress_set_adjustment): 
+       Call gtk_progress_changed() here to update or 
+       queue a resize as necessary.
+
 Wed May 21 14:06:13 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
        * gtk/gtkimcontextsimple.c: added composing rules of
-       Greek acceted letters, patch by Vasilis Vasaitis (#107507)
+       Greek accented letters, patch by Vasilis Vasaitis (#107507)
 
 Wed May 21 13:19:05 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
index c30a6106cefbcd7434435376c2ef0caa09ed4ae9..dda437ed6a924f62ccf52c54465d86b0b844a0a9 100644 (file)
@@ -1,7 +1,23 @@
+Wed May 21 15:53:14 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkprogress.c (gtk_progress_set_format_string,
+       gtk_progress_set_show_text): Always queue a resize ... 
+       we rely on the size-allocate to do the update, plus a 
+       different format can actually change our size requisition.
+       (#111052)
+
+       * gtk/gtkprogress.c (gtk_progress_changed): Track
+       ::changed as well as ::value_changed, and queue a
+       resize on ::changed when necessary.
+
+       * gtk/gtkprogress.c (gtk_progress_set_adjustment): 
+       Call gtk_progress_changed() here to update or 
+       queue a resize as necessary.
+
 Wed May 21 14:06:13 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
        * gtk/gtkimcontextsimple.c: added composing rules of
-       Greek acceted letters, patch by Vasilis Vasaitis (#107507)
+       Greek accented letters, patch by Vasilis Vasaitis (#107507)
 
 Wed May 21 13:19:05 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
index c30a6106cefbcd7434435376c2ef0caa09ed4ae9..dda437ed6a924f62ccf52c54465d86b0b844a0a9 100644 (file)
@@ -1,7 +1,23 @@
+Wed May 21 15:53:14 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkprogress.c (gtk_progress_set_format_string,
+       gtk_progress_set_show_text): Always queue a resize ... 
+       we rely on the size-allocate to do the update, plus a 
+       different format can actually change our size requisition.
+       (#111052)
+
+       * gtk/gtkprogress.c (gtk_progress_changed): Track
+       ::changed as well as ::value_changed, and queue a
+       resize on ::changed when necessary.
+
+       * gtk/gtkprogress.c (gtk_progress_set_adjustment): 
+       Call gtk_progress_changed() here to update or 
+       queue a resize as necessary.
+
 Wed May 21 14:06:13 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
        * gtk/gtkimcontextsimple.c: added composing rules of
-       Greek acceted letters, patch by Vasilis Vasaitis (#107507)
+       Greek accented letters, patch by Vasilis Vasaitis (#107507)
 
 Wed May 21 13:19:05 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
index c30a6106cefbcd7434435376c2ef0caa09ed4ae9..dda437ed6a924f62ccf52c54465d86b0b844a0a9 100644 (file)
@@ -1,7 +1,23 @@
+Wed May 21 15:53:14 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkprogress.c (gtk_progress_set_format_string,
+       gtk_progress_set_show_text): Always queue a resize ... 
+       we rely on the size-allocate to do the update, plus a 
+       different format can actually change our size requisition.
+       (#111052)
+
+       * gtk/gtkprogress.c (gtk_progress_changed): Track
+       ::changed as well as ::value_changed, and queue a
+       resize on ::changed when necessary.
+
+       * gtk/gtkprogress.c (gtk_progress_set_adjustment): 
+       Call gtk_progress_changed() here to update or 
+       queue a resize as necessary.
+
 Wed May 21 14:06:13 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
        * gtk/gtkimcontextsimple.c: added composing rules of
-       Greek acceted letters, patch by Vasilis Vasaitis (#107507)
+       Greek accented letters, patch by Vasilis Vasaitis (#107507)
 
 Wed May 21 13:19:05 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
index c30a6106cefbcd7434435376c2ef0caa09ed4ae9..dda437ed6a924f62ccf52c54465d86b0b844a0a9 100644 (file)
@@ -1,7 +1,23 @@
+Wed May 21 15:53:14 2003  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkprogress.c (gtk_progress_set_format_string,
+       gtk_progress_set_show_text): Always queue a resize ... 
+       we rely on the size-allocate to do the update, plus a 
+       different format can actually change our size requisition.
+       (#111052)
+
+       * gtk/gtkprogress.c (gtk_progress_changed): Track
+       ::changed as well as ::value_changed, and queue a
+       resize on ::changed when necessary.
+
+       * gtk/gtkprogress.c (gtk_progress_set_adjustment): 
+       Call gtk_progress_changed() here to update or 
+       queue a resize as necessary.
+
 Wed May 21 14:06:13 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
        * gtk/gtkimcontextsimple.c: added composing rules of
-       Greek acceted letters, patch by Vasilis Vasaitis (#107507)
+       Greek accented letters, patch by Vasilis Vasaitis (#107507)
 
 Wed May 21 13:19:05 2003  Hidetoshi Tajima  <hidetoshi.tajima@sun.com>
 
index 67339175fedd79787585c9a68acef4590afc1cf9..8bb8e9ca4a93decd1170344ca3b907b0711eb50d 100644 (file)
@@ -62,6 +62,8 @@ static void gtk_progress_size_allocate   (GtkWidget        *widget,
 static void gtk_progress_create_pixmap   (GtkProgress      *progress);
 static void gtk_progress_value_changed   (GtkAdjustment    *adjustment,
                                          GtkProgress      *progress);
+static void gtk_progress_changed         (GtkAdjustment    *adjustment,
+                                         GtkProgress      *progress);
 
 
 static GtkWidgetClass *parent_class = NULL;
@@ -283,6 +285,9 @@ gtk_progress_destroy (GtkObject *object)
       g_signal_handlers_disconnect_by_func (progress->adjustment,
                                            gtk_progress_value_changed,
                                            progress);
+      g_signal_handlers_disconnect_by_func (progress->adjustment,
+                                           gtk_progress_changed,
+                                           progress);
       g_object_unref (progress->adjustment);
       progress->adjustment = NULL;
     }
@@ -368,6 +373,19 @@ gtk_progress_create_pixmap (GtkProgress *progress)
     }
 }
 
+static void
+gtk_progress_changed (GtkAdjustment *adjustment,
+                     GtkProgress   *progress)
+{
+  /* A change in the value of adjustment->upper can change
+   * the size request
+   */
+  if (progress->use_text_format && progress->show_text)
+    gtk_widget_queue_resize (progress);
+  else
+    GTK_PROGRESS_GET_CLASS (progress)->update (progress);
+}
+
 static void
 gtk_progress_value_changed (GtkAdjustment *adjustment,
                            GtkProgress   *progress)
@@ -503,6 +521,9 @@ gtk_progress_set_adjustment (GtkProgress   *progress,
     {
       if (progress->adjustment)
         {
+         g_signal_handlers_disconnect_by_func (progress->adjustment,
+                                               gtk_progress_changed,
+                                               progress);
          g_signal_handlers_disconnect_by_func (progress->adjustment,
                                                gtk_progress_value_changed,
                                                progress);
@@ -513,10 +534,15 @@ gtk_progress_set_adjustment (GtkProgress   *progress,
         {
           g_object_ref (adjustment);
          gtk_object_sink (GTK_OBJECT (adjustment));
+          g_signal_connect (adjustment, "changed",
+                           G_CALLBACK (gtk_progress_changed),
+                           progress);
           g_signal_connect (adjustment, "value_changed",
                            G_CALLBACK (gtk_progress_value_changed),
                            progress);
         }
+
+      gtk_progress_changed (adjustment, progress);
     }
 }
 
@@ -622,8 +648,7 @@ gtk_progress_set_show_text (GtkProgress *progress,
     {
       progress->show_text = show_text;
 
-      if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress)))
-       gtk_widget_queue_resize (GTK_WIDGET (progress));
+      gtk_widget_queue_resize (GTK_WIDGET (progress));
 
       g_object_notify (G_OBJECT (progress), "show_text");
     }
@@ -680,8 +705,7 @@ gtk_progress_set_format_string (GtkProgress *progress,
   progress->format = g_strdup (format);
   g_free (old_format);
   
-  if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (progress)))
-    gtk_widget_queue_resize (GTK_WIDGET (progress));
+  gtk_widget_queue_resize (GTK_WIDGET (progress));
 }
 
 gchar *