summaryrefslogtreecommitdiff
path: root/gtk/gtkcellareabox.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-12 14:06:00 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-12 14:06:00 +0900
commit7e821aa980d7219741946195be38a99d75407264 (patch)
treeb0661d04f2f955fda6704c095a6bb000ec8abdb5 /gtk/gtkcellareabox.c
parent33db66e728357752c8d0ee90b324a5bfab469c72 (diff)
downloadgtk+-7e821aa980d7219741946195be38a99d75407264.tar.gz
Distribute portions of GtkCellArea:render() background_area argument to cells
Also added gtk_cell_area_get/set_style_detail() to set the string to be used by the area in gtk_paint_* functions.
Diffstat (limited to 'gtk/gtkcellareabox.c')
-rw-r--r--gtk/gtkcellareabox.c46
1 files changed, 36 insertions, 10 deletions
diff --git a/gtk/gtkcellareabox.c b/gtk/gtkcellareabox.c
index 0b0f23c624..7fbcf9ba52 100644
--- a/gtk/gtkcellareabox.c
+++ b/gtk/gtkcellareabox.c
@@ -1041,8 +1041,38 @@ gtk_cell_area_box_render (GtkCellArea *area,
*/
gtk_cell_area_inner_cell_area (area, &cell_background, &inner_area);
- /* XXX TODO Here after getting the inner area of the cell background,
+ /* Here after getting the inner area of the cell background,
* add portions of the background area to the cell background */
+ if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ if (l == allocated_cells)
+ {
+ cell_background.width += cell_background.x - background_area->x;
+ cell_background.x = background_area->x;
+ }
+
+ if (l->next == NULL)
+ cell_background.width =
+ background_area->width - (cell_background.x - background_area->x);
+
+ cell_background.y = background_area->y;
+ cell_background.height = background_area->height;
+ }
+ else
+ {
+ if (l == allocated_cells)
+ {
+ cell_background.height += cell_background.y - background_area->y;
+ cell_background.y = background_area->y;
+ }
+
+ if (l->next == NULL)
+ cell_background.height =
+ background_area->height - (cell_background.y - background_area->y);
+
+ cell_background.x = background_area->x;
+ cell_background.width = background_area->width;
+ }
if (focus_cell &&
(cell->renderer == focus_cell ||
@@ -1108,15 +1138,11 @@ gtk_cell_area_box_render (GtkCellArea *area,
(flags & GTK_CELL_RENDERER_PRELIT ? GTK_STATE_PRELIGHT :
(flags & GTK_CELL_RENDERER_INSENSITIVE ? GTK_STATE_INSENSITIVE : GTK_STATE_NORMAL));
- gtk_paint_focus (gtk_widget_get_style (widget),
- cr, renderer_state,
- widget,
- /* XXX This hint should be a property on GtkCellArea I suppose */
- "treeview",
- focus_rect.x,
- focus_rect.y,
- focus_rect.width,
- focus_rect.height);
+ gtk_paint_focus (gtk_widget_get_style (widget), cr,
+ renderer_state, widget,
+ gtk_cell_area_get_style_detail (area),
+ focus_rect.x, focus_rect.y,
+ focus_rect.width, focus_rect.height);
}