summaryrefslogtreecommitdiff
path: root/gtk/gtkcellareabox.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-29 16:14:46 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2010-11-29 16:14:46 +0900
commit5f427ff476d1f434ec107552547cc928d711111a (patch)
tree73654a926a0254d1eb9c9f75268084ec8cbe0403 /gtk/gtkcellareabox.c
parent87892261e0637040714239cd2298d289a1a28ddb (diff)
downloadgtk+-5f427ff476d1f434ec107552547cc928d711111a.tar.gz
Make focus rectangle painted on all cells if the GtkCellAreaBox is requested to paint focus and none of the cells are activatable.
Diffstat (limited to 'gtk/gtkcellareabox.c')
-rw-r--r--gtk/gtkcellareabox.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gtk/gtkcellareabox.c b/gtk/gtkcellareabox.c
index 00634ad3b4..5e25c8af98 100644
--- a/gtk/gtkcellareabox.c
+++ b/gtk/gtkcellareabox.c
@@ -1129,11 +1129,17 @@ gtk_cell_area_box_render (GtkCellArea *area,
GtkCellRenderer *focus_cell = NULL;
GdkRectangle focus_rect = { 0, };
gboolean first_focus_cell = TRUE;
+ gboolean focus_all = FALSE;
if (flags & GTK_CELL_RENDERER_FOCUSED)
{
focus_cell = gtk_cell_area_get_focus_cell (area);
flags &= ~GTK_CELL_RENDERER_FOCUSED;
+
+ /* If no cell can activate but the caller wants focus painted,
+ * then we paint focus around all cells */
+ if (paint_focus && !gtk_cell_area_can_focus (area))
+ focus_all = TRUE;
}
cell_background = *cell_area;
@@ -1199,9 +1205,10 @@ gtk_cell_area_box_render (GtkCellArea *area,
render_background.width = background_area->width;
}
- if (focus_cell &&
- (cell->renderer == focus_cell ||
- gtk_cell_area_is_focus_sibling (area, focus_cell, cell->renderer)))
+ if (focus_all ||
+ (focus_cell &&
+ (cell->renderer == focus_cell ||
+ gtk_cell_area_is_focus_sibling (area, focus_cell, cell->renderer))))
{
cell_fields |= GTK_CELL_RENDERER_FOCUSED;