diff options
author | Benjamin Berg <benjamin@sipsolutions.net> | 2008-01-27 16:53:01 (GMT) |
---|---|---|
committer | Benjamin Berg <benjamin@sipsolutions.net> | 2008-01-27 16:53:01 (GMT) |
commit | 785579323728c421b40de6a0b26bc316ad0e2743 (patch) | |
tree | 05c575b295da749254f8df1afb9b39119899032a /gtk | |
parent | 46b954ab6f651bcf53a63ac4145ebca0525afabf (diff) |
Make the button text workaround work for buttons with both an icon and text.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/engine/sugar-style.c | 8 |
1 files changed, 7 insertions, 1 deletions
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) { |