]> Pileus Git - ~andy/gtk/commitdiff
Make toolbutton not call functions on non-GtkMisc
authorBenjamin Otte <otte@redhat.com>
Mon, 3 May 2010 16:22:42 +0000 (18:22 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 3 May 2010 18:20:44 +0000 (20:20 +0200)
gtk/gtktoolbutton.c

index 422540168f4d12804d142c7e3392839885a58c7f..0e6ae592a96c8dfe2e9bec730b42d707a86ac2f4 100644 (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)));