diff options
author | Paolo Borelli <pborelli@gnome.org> | 2012-12-23 16:34:27 +0100 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2012-12-23 16:35:55 +0100 |
commit | 70a5718b155d5342444e056b2f3b01cbe501a741 (patch) | |
tree | 12c020e6384f394d2c6ce3eed00915698fd9a5eb /gtk | |
parent | 4f2da634f1d5f172a7e3e7eb1061ff8b3c51ae8e (diff) | |
download | gtk+-70a5718b155d5342444e056b2f3b01cbe501a741.tar.gz |
Paint GtkFrame background correctly when there is a label
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkframe.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index fb62cc76e0..9b81631394 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -689,8 +689,6 @@ gtk_frame_draw (GtkWidget *widget, width = priv->child_allocation.width + padding.left + padding.right; height = priv->child_allocation.height + padding.top + padding.bottom; - gtk_render_background (context, cr, x, y, width, height); - if (priv->shadow_type != GTK_SHADOW_NONE) { if (priv->label_widget) @@ -710,6 +708,9 @@ gtk_frame_draw (GtkWidget *widget, height += height_extra; x2 = padding.left + (priv->child_allocation.width - priv->label_allocation.width - 2 * LABEL_PAD - 2 * LABEL_SIDE_PAD) * xalign + LABEL_SIDE_PAD; + + gtk_render_background (context, cr, x, y, width, height); + /* If the label is completely over or under the frame we can omit the gap */ if (priv->label_yalign == 0.0 || priv->label_yalign == 1.0) gtk_render_frame (context, cr, x, y, width, height); @@ -720,7 +721,14 @@ gtk_frame_draw (GtkWidget *widget, x2 + priv->label_allocation.width + 2 * LABEL_PAD); } else - gtk_render_frame (context, cr, x, y, width, height); + { + gtk_render_background (context, cr, x, y, width, height); + gtk_render_frame (context, cr, x, y, width, height); + } + } + else + { + gtk_render_background (context, cr, x, y, width, height); } GTK_WIDGET_CLASS (gtk_frame_parent_class)->draw (widget, cr); |