From b59ff6e2f0e09ca24c6f9a08590cc4be9ccb2cef Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Thu, 13 Sep 2001 18:33:21 +0000 Subject: Changed this to change state on button down, even if we aren't editing. 2001-09-13 Christopher James Lahey * e-cell-toggle.c (etog_event): Changed this to change state on button down, even if we aren't editing. svn path=/trunk/; revision=12803 --- widgets/table/e-cell-toggle.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'widgets') diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index e85418e593..b4938ea55c 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * e-cell-toggle.c: Multi-state image toggle cell object. * @@ -188,27 +189,23 @@ etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, void *_value = e_table_model_value_at (ecell_view->e_table_model, model_col, row); const int value = GPOINTER_TO_INT (_value); - if (flags & !E_CELL_EDITING) - return 0; - +#if 0 + if (!(flags & E_CELL_EDITING)) + return FALSE; +#endif + switch (event->type){ - case GDK_BUTTON_RELEASE: + case GDK_KEY_PRESS: + if (event->key.keyval != GDK_space) + return FALSE; + /* Fall through */ + case GDK_BUTTON_PRESS: if (!e_table_model_is_cell_editable(ecell_view->e_table_model, model_col, row)) return FALSE; etog_set_value (toggle_view, model_col, view_col, row, value + 1); return TRUE; - case GDK_KEY_PRESS: - if (!e_table_model_is_cell_editable(ecell_view->e_table_model, model_col, row)) - return FALSE; - - if (event->key.keyval == GDK_space){ - etog_set_value (toggle_view, model_col, view_col, row, value + 1); - return TRUE; - } - return FALSE; - default: return FALSE; } -- cgit