From 9e2412ce340e7e39a1fe6532151afd4fdbe8bb37 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Sun, 20 Jul 2008 17:02:33 +0000 Subject: Committing on behalf of Milan Crha 2008-07-15 Milan Crha ** Part of fix for bug #329821 * e-table-item.c: (find_cell): Do not consider last row's height till the bottom. * e-table-item.h: (e_table_item_compute_mouse_over): * e-table-item.c: (e_table_item_compute_mouse_over): * e-table-group-container.c: (etgc_compute_mouse_over), (etgc_class_init): * e-table-group-leaf.c: (etgl_compute_mouse_over), (etgl_class_init): * e-table.h: (e_table_get_mouse_over_cell): * e-table.c: (e_table_get_mouse_over_cell): * e-table-group.h: (struct ETableGroupClass), (e_table_group_compute_mouse_over): * e-table-group.c: (e_table_group_compute_mouse_over), (etg_class_init): Be able to calculate mouse-over position correctly, relatively to the ETableItem. svn path=/trunk/; revision=35778 --- widgets/table/e-table-group-container.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'widgets/table/e-table-group-container.c') diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 56562fd5b6..2c61eee775 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -688,6 +688,32 @@ etgc_compute_location (ETableGroup *etg, int *x, int *y, int *row, int *col) } } +static void +etgc_compute_mouse_over (ETableGroup *etg, int x, int y, int *row, int *col) +{ + ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg); + + if (row) + *row = -1; + if (col) + *col = -1; + + x -= GROUP_INDENT; + y -= TITLE_HEIGHT; + + if (x >= 0 && y >= 0 && etgc->children) { + GList *list; + for (list = etgc->children; list; list = list->next) { + ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *)list->data; + ETableGroup *child = child_node->child; + + e_table_group_compute_mouse_over (child, x, y, row, col); + if ((*row != -1) && (*col != -1)) + return; + } + } +} + static void etgc_get_cell_geometry (ETableGroup *etg, int *row, int *col, int *x, int *y, int *width, int *height) { @@ -889,6 +915,7 @@ etgc_class_init (ETableGroupContainerClass *klass) e_group_class->get_focus_column = etgc_get_focus_column; e_group_class->get_printable = etgc_get_printable; e_group_class->compute_location = etgc_compute_location; + e_group_class->compute_mouse_over = etgc_compute_mouse_over; e_group_class->get_cell_geometry = etgc_get_cell_geometry; g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS, -- cgit v1.2.3