[gtk+] Paint label background
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Paint label background
- Date: Mon, 30 Apr 2012 17:14:18 +0000 (UTC)
commit 03bf85ba07f455a92283a3030fb8441b776b7e38
Author: Paolo Borelli <pborelli gnome org>
Date: Fri Feb 24 14:30:49 2012 +0100
Paint label background
Make GtkLabel respect background css properties.
https://bugzilla.gnome.org/show_bug.cgi?id=670743
gtk/gtklabel.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 14c0f88..b481ac5 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -4035,13 +4035,20 @@ gtk_label_draw (GtkWidget *widget,
gtk_label_ensure_layout (label);
+ context = gtk_widget_get_style_context (widget);
+ gtk_widget_get_allocation (widget, &allocation);
+
+ gtk_render_background (context, cr,
+ 0, 0,
+ allocation.width, allocation.height);
+ gtk_render_frame (context, cr,
+ 0, 0,
+ allocation.width, allocation.height);
+
if (priv->text && (*priv->text != '\0'))
{
get_layout_location (label, &x, &y);
- context = gtk_widget_get_style_context (widget);
- gtk_widget_get_allocation (widget, &allocation);
-
cairo_translate (cr, -allocation.x, -allocation.y);
gtk_render_layout (context, cr,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]