]> Pileus Git - ~andy/gtk/commitdiff
Fixed GtkSpinner to request 12x12 at init time instead of at expose time.
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Mon, 19 Apr 2010 00:46:30 +0000 (20:46 -0400)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Mon, 19 Apr 2010 00:46:30 +0000 (20:46 -0400)
This should not change the space taken by the spinner when hidden,
and it should only set the minimum size not the actual size (i.e. code
in place was conditionally setting it if not allocated 12x12, which
doesnt really make sense)... This fixes spinners showing at the correct size
in gtk-demo.

gtk/gtkspinner.c

index 736b03f406c8b65d300306392d8f317f6b8dd212..0f328ac0f0652a93f2dce7fa36fb69449cd61f8e 100644 (file)
@@ -211,6 +211,8 @@ gtk_spinner_init (GtkSpinner *spinner)
 
   spinner->priv = priv;
 
+  gtk_widget_set_size_request (GTK_WIDGET (spinner), 12, 12);
+
   gtk_widget_set_has_window (GTK_WIDGET (spinner), FALSE);
 }
 
@@ -220,16 +222,9 @@ gtk_spinner_expose (GtkWidget      *widget,
 {
   GtkStateType state_type;
   GtkSpinnerPrivate *priv;
-  int width, height;
 
   priv = GTK_SPINNER (widget)->priv;
 
-  width = widget->allocation.width;
-  height = widget->allocation.height;
-
-  if ((width < 12) || (height <12))
-    gtk_widget_set_size_request (widget, 12, 12);
-
   state_type = GTK_STATE_NORMAL;
   if (!gtk_widget_is_sensitive (widget))
    state_type = GTK_STATE_INSENSITIVE;