Make toolbutton not call functions on non-GtkMisc

This commit is contained in:
Benjamin Otte 2010-05-03 18:22:42 +02:00 committed by Tomeu Vizoso
parent 807c14741f
commit b1cc8b9cd8

View File

@ -470,11 +470,11 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
gtk_widget_show (icon);
}
if (icon && text_orientation == GTK_ORIENTATION_HORIZONTAL)
if (GTK_IS_MISC (icon) && text_orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_misc_set_alignment (GTK_MISC (icon),
1.0 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
0.5);
else if (icon)
else if (GTK_IS_MISC (icon))
gtk_misc_set_alignment (GTK_MISC (icon),
0.5,
gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));