Fixed GtkSpinner to request 12x12 at init time instead of at expose time.

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.
This commit is contained in:
Tristan Van Berkom 2010-04-18 20:46:30 -04:00
parent 4c1fa76520
commit 0dff033a64

View 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;