summaryrefslogtreecommitdiff
path: root/gtk/gtkcellview.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-08-30 14:56:28 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-08-30 14:56:28 +0900
commit54d44a9bd04cfbed8426614fc69c027a46f41a14 (patch)
tree34bdf65a6e8d5d6d4016154345d1d803ba0da379 /gtk/gtkcellview.c
parentb3b22c31b997fb85b3319b392a1a69407703184c (diff)
parent67194ed77b153eb5a7eb6c596f3c20e274b7787a (diff)
downloadgtk+-native-layout.tar.gz
Merge branch 'master' into native-layoutnative-layout
Conflicts: gtk/gtkplug.c gtk/gtkscrolledwindow.c
Diffstat (limited to 'gtk/gtkcellview.c')
-rw-r--r--gtk/gtkcellview.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gtk/gtkcellview.c b/gtk/gtkcellview.c
index bf15a3e514..305e7e7f14 100644
--- a/gtk/gtkcellview.c
+++ b/gtk/gtkcellview.c
@@ -344,7 +344,7 @@ gtk_cell_view_size_allocate (GtkWidget *widget,
gint extra_per_cell, extra_extra, i;
gboolean first_cell = TRUE;
- widget->allocation = *allocation;
+ gtk_widget_set_allocation (widget, allocation);
cellview = GTK_CELL_VIEW (widget);
@@ -429,6 +429,7 @@ static gboolean
gtk_cell_view_expose (GtkWidget *widget,
GdkEventExpose *event)
{
+ GtkAllocation allocation;
GList *list;
GtkCellView *cellview;
GdkRectangle area;
@@ -441,12 +442,14 @@ gtk_cell_view_expose (GtkWidget *widget,
if (!gtk_widget_is_drawable (widget))
return FALSE;
+ gtk_widget_get_allocation (widget, &allocation);
+
/* "blank" background */
if (cellview->priv->background_set)
{
- cairo_t *cr = gdk_cairo_create (GTK_WIDGET (cellview)->window);
+ cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (GTK_WIDGET (cellview)));
- gdk_cairo_rectangle (cr, &widget->allocation);
+ gdk_cairo_rectangle (cr, &allocation);
cairo_set_source_rgb (cr,
cellview->priv->background.red / 65535.,
cellview->priv->background.green / 65535.,
@@ -463,10 +466,10 @@ gtk_cell_view_expose (GtkWidget *widget,
return FALSE;
/* render cells */
- area = widget->allocation;
+ area = allocation;
/* we draw on our very own window, initialize x and y to zero */
- area.y = widget->allocation.y;
+ area.y = allocation.y;
if (gtk_widget_get_state (widget) == GTK_STATE_PRELIGHT)
state = GTK_CELL_RENDERER_PRELIT;
@@ -478,9 +481,9 @@ gtk_cell_view_expose (GtkWidget *widget,
for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing)
{
if (packing == GTK_PACK_START)
- area.x = widget->allocation.x + (rtl ? widget->allocation.width : 0);
+ area.x = allocation.x + (rtl ? allocation.width : 0);
else
- area.x = rtl ? widget->allocation.x : (widget->allocation.x + widget->allocation.width);
+ area.x = rtl ? allocation.x : (allocation.x + allocation.width);
for (list = cellview->priv->cell_list; list; list = list->next)
{