diff options
author | Kristian Rietveld <kris@gtk.org> | 2010-12-15 21:17:27 +0100 |
---|---|---|
committer | Kristian Rietveld <kris@gtk.org> | 2010-12-15 21:17:27 +0100 |
commit | be39883de2cafe5240fac5c38fbcd143d1065392 (patch) | |
tree | 76b3705abfcce7a67953693a23b97efcf76b95c6 /gtk/gtkcellarea.c | |
parent | 8ca6bbbfc0c960871ca0b191681552d09462f837 (diff) | |
download | gtk+-be39883de2cafe5240fac5c38fbcd143d1065392.tar.gz |
Correct calculation of the cell focus rectangle
The cell's focus rectangle is located around the cell's aligned area.
To get to the correct coordinates for this rectangle, we have to subtract
focus_line_width from the found aligned_area.
Diffstat (limited to 'gtk/gtkcellarea.c')
-rw-r--r-- | gtk/gtkcellarea.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gtkcellarea.c b/gtk/gtkcellarea.c index 079ab56afe..10190214e6 100644 --- a/gtk/gtkcellarea.c +++ b/gtk/gtkcellarea.c @@ -1056,10 +1056,21 @@ render_cell (GtkCellRenderer *renderer, (renderer == focus_cell || gtk_cell_area_is_focus_sibling (data->area, focus_cell, renderer))))) { + gint focus_line_width; GdkRectangle cell_focus; gtk_cell_renderer_get_aligned_area (renderer, data->widget, flags, &inner_area, &cell_focus); + gtk_widget_style_get (data->widget, + "focus-line-width", &focus_line_width, + NULL); + + /* The focus rectangle is located around the aligned area of the cell */ + cell_focus.x -= focus_line_width; + cell_focus.y -= focus_line_width; + cell_focus.width += 2 * focus_line_width; + cell_focus.height += 2 * focus_line_width; + if (data->first_focus) { data->first_focus = FALSE; |