Don't left align label in check buttons when they have no indicator

Because they should be normal buttons in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=681617
This commit is contained in:
William Jon McCann 2012-08-10 13:41:48 -04:00
parent de3cfa6034
commit 515e211d0b

View File

@ -105,12 +105,25 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
GTK_PARAM_READABLE));
}
static void
draw_indicator_changed (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
GtkButton *button = GTK_BUTTON (object);
if (gtk_toggle_button_get_mode (GTK_TOGGLE_BUTTON (button)))
gtk_button_set_alignment (button, 0.0, 0.5);
else
gtk_button_set_alignment (button, 0.5, 0.5);
}
static void
gtk_check_button_init (GtkCheckButton *check_button)
{
gtk_widget_set_receives_default (GTK_WIDGET (check_button), FALSE);
g_signal_connect (check_button, "notify::draw-indicator", G_CALLBACK (draw_indicator_changed), NULL);
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (check_button), TRUE);
gtk_button_set_alignment (GTK_BUTTON (check_button), 0.0, 0.5);
}
/**