From c5dd7f11856134dd0ba1d32bbffb203daf939867 Mon Sep 17 00:00:00 2001 From: Richard Hult Date: Mon, 2 Jul 2001 08:40:24 +0000 Subject: Calculate the popup position using window coordinates instead of world 2001-07-02 Richard Hult * e-cell-combo.c (e_cell_combo_get_popup_pos): Calculate the popup position using window coordinates instead of world coordinates. This fixes bug #2613 in ximian's bugzilla, combo box pops up with offset if the table is scrolled. svn path=/trunk/; revision=10671 --- widgets/table/e-cell-combo.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'widgets/table/e-cell-combo.c') diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 07a14340b9..407420e14b 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -340,6 +340,7 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, gint avail_height, avail_width, min_height, work_height, screen_width; gint column_width, row_height, scrollbar_width; double x1, y1; + double wx, wy; /* This code is practically copied from GtkCombo. */ popup = GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window); @@ -355,6 +356,14 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, eti->editing_row + 1); gnome_canvas_item_i2w (GNOME_CANVAS_ITEM (eti), &x1, &y1); + gnome_canvas_world_to_window (GNOME_CANVAS (canvas), + x1, + y1, + &wx, + &wy); + x1 = wx; + y1 = wy; + *x += x1; /* The ETable positions don't include the grid lines, I think, so we add 1. */ -- cgit v1.2.3