From 410f3bc629f38cb76a5d16209a07e2c336ed1f9f Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 4 Dec 2001 21:03:28 +0000 Subject: Merging changes: 2001-12-04 Christopher James Lahey * configure.in (GAL_CURRENT): Bumped version number to 0.18.99.0 and CURRENT to 19. 2001-11-21 Christopher James Lahey * gal/widgets/e-reflow.c, gal/widgets/e-reflow.h: Handle selection_row_changed signal. * gal/widgets/e-selection-model-array.c, gal/widgets/e-selection-model-array.h: Properly send selection_row_changed signals if changing from a single row selected to a single other row selected or if moving the selection_end by a single row. * gal/widgets/e-selection-model.c, gal/widgets/e-selection-model.h: Added selection_row_changed signal. (e_selection_model_select_as_key_press): Fixed the case statement here to make MULTIPLE and EXTENDED the same as BROWSE instead of as SINGLE. From gal/e-table/ChangeLog: 2001-11-21 Christopher James Lahey * e-table-item.c, e-table-item.h: Handle selection_row_changed signal. Keep track of the old cursor row so that we only redraw two rows when the cursor changes. * e-table.c, e-tree.c: Handle selection_row_changed signal. * e-tree-selection-model.c: Properly send selection_row_changed signals if changing from a single row selected to a single other row selected or if moving the selection_end by a single row. svn path=/trunk/; revision=14870 --- widgets/misc/e-reflow.c | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) (limited to 'widgets/misc/e-reflow.c') diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index 6287ce45ad..ed83956232 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -117,6 +117,22 @@ e_reflow_resize_children (GnomeCanvasItem *item) } } +static inline void +e_reflow_update_selection_row (EReflow *reflow, int row) +{ + if (reflow->items[row]) { + gtk_object_set(GTK_OBJECT(reflow->items[row]), + "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), row), + NULL); + } else if (e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row)) { + reflow->items[row] = e_reflow_model_incarnate (reflow->model, row, GNOME_CANVAS_GROUP (reflow)); + gtk_object_set (GTK_OBJECT (reflow->items[row]), + "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), row), + "width", (double) reflow->column_width, + NULL); + } +} + static void e_reflow_update_selection (EReflow *reflow) { @@ -125,17 +141,7 @@ e_reflow_update_selection (EReflow *reflow) count = reflow->count; for (i = 0; i < count; i++) { - if (reflow->items[i]) { - gtk_object_set(GTK_OBJECT(reflow->items[i]), - "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), i), - NULL); - } else if (e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), i)) { - reflow->items[i] = e_reflow_model_incarnate (reflow->model, i, GNOME_CANVAS_GROUP (reflow)); - gtk_object_set (GTK_OBJECT (reflow->items[i]), - "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), i), - "width", (double) reflow->column_width, - NULL); - } + e_reflow_update_selection_row (reflow, i); } } @@ -145,6 +151,12 @@ selection_changed (ESelectionModel *selection, EReflow *reflow) e_reflow_update_selection (reflow); } +static void +selection_row_changed (ESelectionModel *selection, int row, EReflow *reflow) +{ + e_reflow_update_selection_row (reflow, row); +} + static void cursor_changed (ESelectionModel *selection, int row, int col, EReflow *reflow) { @@ -452,11 +464,14 @@ disconnect_selection (EReflow *reflow) gtk_signal_disconnect (GTK_OBJECT (reflow->selection), reflow->selection_changed_id); + gtk_signal_disconnect (GTK_OBJECT (reflow->selection), + reflow->selection_row_changed_id); gtk_signal_disconnect (GTK_OBJECT (reflow->selection), reflow->cursor_changed_id); gtk_object_unref (GTK_OBJECT (reflow->selection)); reflow->selection_changed_id = 0; + reflow->selection_row_changed_id = 0; reflow->cursor_changed_id = 0; reflow->selection = NULL; } @@ -1308,6 +1323,9 @@ e_reflow_init (EReflow *reflow) reflow->selection_changed_id = gtk_signal_connect(GTK_OBJECT(reflow->selection), "selection_changed", GTK_SIGNAL_FUNC(selection_changed), reflow); + reflow->selection_row_changed_id = + gtk_signal_connect(GTK_OBJECT(reflow->selection), "selection_row_changed", + GTK_SIGNAL_FUNC(selection_row_changed), reflow); reflow->cursor_changed_id = gtk_signal_connect(GTK_OBJECT(reflow->selection), "cursor_changed", GTK_SIGNAL_FUNC(cursor_changed), reflow); -- cgit v1.2.3