aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--a11y/e-table/gal-a11y-e-cell.c22
-rw-r--r--widgets/table/e-cell-text.c4
2 files changed, 26 insertions, 0 deletions
diff --git a/a11y/e-table/gal-a11y-e-cell.c b/a11y/e-table/gal-a11y-e-cell.c
index db4135bf1d..a387c6ed6f 100644
--- a/a11y/e-table/gal-a11y-e-cell.c
+++ b/a11y/e-table/gal-a11y-e-cell.c
@@ -7,6 +7,7 @@
*/
#include <config.h>
+#include "gal/e-table/e-table.h"
#include "gal-a11y-e-cell.h"
#include "gal-a11y-util.h"
#include <atk/atkobject.h>
@@ -112,12 +113,33 @@ eti_get_extents (AtkComponent *component,
*y += yval;
}
+static gboolean
+eti_grab_focus (AtkComponent *component)
+{
+ GalA11yECell *a11y;
+ gint view_row;
+ GtkWidget *e_table, *toplevel;
+
+ a11y = GAL_A11Y_E_CELL (component);
+ e_table = gtk_widget_get_parent (GNOME_CANVAS_ITEM (a11y->item)->canvas);
+ view_row = e_table_view_to_model_row (E_TABLE (e_table), a11y->row);
+
+ e_selection_model_clear (a11y->item->selection);
+ e_selection_model_select_single_row (a11y->item->selection, view_row);
+
+ gtk_widget_grab_focus (e_table);
+ toplevel = gtk_widget_get_toplevel (e_table);
+ if (GTK_WIDGET_TOPLEVEL (toplevel))
+ gtk_window_present (toplevel);
+}
+
/* Table IFace */
static void
eti_atk_component_iface_init (AtkComponentIface *iface)
{
iface->get_extents = eti_get_extents;
+ iface->grab_focus = eti_grab_focus;
}
static void
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index e3e5b664d5..5a0da69a7c 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -54,6 +54,8 @@
#include "gal/util/e-text-event-processor-emacs-like.h"
#include "gal/util/e-i18n.h"
#include "e-table-tooltip.h"
+#include "gal/a11y/e-table/gal-a11y-e-cell-registry.h"
+#include "gal/a11y/e-table/gal-a11y-e-cell-text.h"
#define d(x)
#define DO_SELECTION 1
@@ -1724,6 +1726,8 @@ e_cell_text_class_init (GObjectClass *object_class)
use_ellipsis_default = FALSE;
}
}
+
+ gal_a11y_e_cell_registry_add_cell_type (NULL, E_CELL_TEXT_TYPE, gal_a11y_e_cell_text_new);
}