diff options
author | Paolo Borelli <pborelli@gnome.org> | 2013-11-02 12:21:51 +0100 |
---|---|---|
committer | Paolo Borelli <pborelli@gnome.org> | 2013-11-03 14:13:16 +0100 |
commit | 144a92ef114489979b7261cfa057901d0cd9ebaf (patch) | |
tree | 5c282649cf0a6ed4d1eedcf2b24cbc2a88431872 /gtk/gtkgrid.c | |
parent | ba6128f8afc90bc32b45559f9c24964e78f6ff3d (diff) | |
download | gtk+-144a92ef114489979b7261cfa057901d0cd9ebaf.tar.gz |
grid: draw css background and borders
https://bugzilla.gnome.org/show_bug.cgi?id=711324
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r-- | gtk/gtkgrid.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index 7e7f7a7aef..23cbc5365d 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -1682,6 +1682,22 @@ gtk_grid_size_allocate (GtkWidget *widget, gtk_grid_request_allocate_children (&request); } +static gboolean +gtk_grid_draw (GtkWidget *widget, + cairo_t *cr) +{ + GtkStyleContext *context; + GtkAllocation allocation; + + 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); + + return GTK_WIDGET_CLASS (gtk_grid_parent_class)->draw (widget, cr); +} + static void gtk_grid_class_init (GtkGridClass *class) { @@ -1699,6 +1715,7 @@ gtk_grid_class_init (GtkGridClass *class) widget_class->get_preferred_width_for_height = gtk_grid_get_preferred_width_for_height; widget_class->get_preferred_height_for_width = gtk_grid_get_preferred_height_for_width; widget_class->get_preferred_height_and_baseline_for_width = gtk_grid_get_preferred_height_and_baseline_for_width; + widget_class->draw = gtk_grid_draw; container_class->add = gtk_grid_add; container_class->remove = gtk_grid_remove; |