From 785579323728c421b40de6a0b26bc316ad0e2743 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Sun, 27 Jan 2008 16:53:01 +0000 Subject: Make the button text workaround work for buttons with both an icon and text. --- diff --git a/gtk/engine/sugar-style.c b/gtk/engine/sugar-style.c index 97a3062..5f6d30a 100644 --- a/gtk/engine/sugar-style.c +++ b/gtk/engine/sugar-style.c @@ -754,9 +754,15 @@ sugar_style_draw_layout(GtkStyle *style, btn = widget->parent; if (btn && !GTK_IS_BUTTON (btn)) { + /* A button with a label and an image has the following layout: + * button(alignment(box(image, label))) + * So try to walk up the widget hirachy far enough for this layout. */ if (btn->parent && GTK_IS_BUTTON (btn->parent)) btn = btn->parent; - else + else if (btn->parent && btn->parent->parent && + GTK_IS_BUTTON (btn->parent->parent)) + btn = btn->parent->parent; + else /* It appears, that this is not a label inside a button. */ btn = NULL; } if (state_type != GTK_STATE_INSENSITIVE && btn) { -- cgit v0.9.1