diff options
author | Paolo Borelli <pborelli@gnome.org> | 2013-11-02 12:21:30 +0100 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2013-11-03 14:13:16 +0100 |
commit | ba6128f8afc90bc32b45559f9c24964e78f6ff3d (patch) | |
tree | f0d09e319cdf501bfb4e0292b49542da6c60f223 /gtk/gtkfixed.c | |
parent | 3c2829713463228094d66170564a4d6d7c31c245 (diff) | |
download | gtk+-ba6128f8afc90bc32b45559f9c24964e78f6ff3d.tar.gz |
fixed: draw css background and borders
https://bugzilla.gnome.org/show_bug.cgi?id=711324
Diffstat (limited to 'gtk/gtkfixed.c')
-rw-r--r-- | gtk/gtkfixed.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c index ec3467ffe3..1d2ab3f772 100644 --- a/gtk/gtkfixed.c +++ b/gtk/gtkfixed.c @@ -99,6 +99,8 @@ static void gtk_fixed_get_preferred_height (GtkWidget *widget, gint *natural); static void gtk_fixed_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static gboolean gtk_fixed_draw (GtkWidget *widget, + cairo_t *cr); static void gtk_fixed_add (GtkContainer *container, GtkWidget *widget); static void gtk_fixed_remove (GtkContainer *container, @@ -135,6 +137,7 @@ gtk_fixed_class_init (GtkFixedClass *class) widget_class->get_preferred_width = gtk_fixed_get_preferred_width; widget_class->get_preferred_height = gtk_fixed_get_preferred_height; widget_class->size_allocate = gtk_fixed_size_allocate; + widget_class->draw = gtk_fixed_draw; container_class->add = gtk_fixed_add; container_class->remove = gtk_fixed_remove; @@ -486,6 +489,22 @@ gtk_fixed_size_allocate (GtkWidget *widget, } } +static gboolean +gtk_fixed_draw (GtkWidget *widget, + cairo_t *cr) +{ + GtkStyleContext *context; + GtkAllocation alloc; + + context = gtk_widget_get_style_context (widget); + gtk_widget_get_allocation (widget, &alloc); + + gtk_render_background (context, cr, 0, 0, alloc.width, alloc.height); + gtk_render_frame (context, cr, 0, 0, alloc.width, alloc.height); + + return GTK_WIDGET_CLASS (gtk_fixed_parent_class)->draw (widget, cr); +} + static void gtk_fixed_add (GtkContainer *container, GtkWidget *widget) |