diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-08 12:26:12 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-08 12:26:12 +0800 |
commit | cea054cd54d84479352a43bbabc19c9ce9af5efb (patch) | |
tree | ba02763209ba0f22989024004f57689071603ec5 /widgets/table/e-table-item.c | |
parent | 91a6b6899e5568ed34f913bedb538dd6c9e35b32 (diff) | |
download | gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.gz gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.tar.zst gsoc2013-evolution-cea054cd54d84479352a43bbabc19c9ce9af5efb.zip |
Merge revisions 35747:35930 from trunk.
svn path=/branches/kill-bonobo/; revision=35931
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r-- | widgets/table/e-table-item.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 3e29680574..a4ec641cc0 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -2171,12 +2171,15 @@ find_cell (ETableItem *eti, double x, double y, int *view_col_res, int *view_row y1 = y2 = height_extra; if (y < height_extra) return FALSE; - for (row = 0; row < rows - 1; row++, y1 = y2){ + for (row = 0; row < rows; row++, y1 = y2) { y2 += ETI_ROW_HEIGHT (eti, row) + height_extra; if (y <= y2) break; } + + if (row == rows) + return FALSE; } *view_col_res = col; if (x1_res) @@ -3442,6 +3445,37 @@ e_table_item_compute_location (ETableItem *eti, eti->grabbed_row = grabbed_row; } +/** + * e_table_item_compute_mouse_over: + * Similar to e_table_item_compute_location, only here recalculating + * the position inside the item too. + **/ +void +e_table_item_compute_mouse_over (ETableItem *eti, + int x, + int y, + int *row, + int *col) +{ + double realx, realy; + /* Save the grabbed row but make sure that we don't get flawed + results because the cursor is grabbed. */ + int grabbed_row = eti->grabbed_row; + eti->grabbed_row = -1; + + realx = x; + realy = y; + + gnome_canvas_item_w2i (GNOME_CANVAS_ITEM (eti), &realx, &realy); + + if (!find_cell (eti, (int)realx, (int)realy, col, row, NULL, NULL)) { + *row = -1; + *col = -1; + } + + eti->grabbed_row = grabbed_row; +} + void e_table_item_get_cell_geometry (ETableItem *eti, int *row, |