[gtk+] a11y: Emit focus change events when focus cell changes
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: Emit focus change events when focus cell changes
- Date: Sat, 11 Feb 2012 04:16:10 +0000 (UTC)
commit 24db6d7a6f6e3b751055642edf719e9eecfb96f7
Author: Benjamin Otte <otte redhat com>
Date: Sat Feb 11 03:00:04 2012 +0100
a11y: Emit focus change events when focus cell changes
gtk/a11y/gtktreeviewaccessible.c | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index d6a4fb2..3dfedfa 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -2095,6 +2095,43 @@ _gtk_tree_view_accessible_update_focus_column (GtkTreeView *treeview,
GtkTreeViewColumn *old_focus,
GtkTreeViewColumn *new_focus)
{
+ GtkTreeViewAccessible *accessible;
+ AtkObject *obj;
+ GtkRBTree *cursor_tree;
+ GtkRBNode *cursor_node;
+ GtkCellAccessible *cell;
+
+ old_focus = get_effective_focus_column (treeview, old_focus);
+ new_focus = get_effective_focus_column (treeview, new_focus);
+ if (old_focus == new_focus)
+ return;
+
+ obj = _gtk_widget_peek_accessible (GTK_WIDGET (treeview));
+ if (obj == NULL)
+ return;
+
+ accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
+
+ if (!_gtk_tree_view_get_cursor_node (treeview, &cursor_tree, &cursor_node))
+ return;
+
+ if (old_focus)
+ {
+ cell = peek_cell (accessible, cursor_tree, cursor_node, old_focus);
+ if (cell != NULL)
+ _gtk_cell_accessible_state_changed (cell, GTK_CELL_RENDERER_FOCUSED, 0);
+ }
+
+ if (new_focus)
+ {
+ /* XXX: force creation here */
+ cell = peek_cell (accessible, cursor_tree, cursor_node, new_focus);
+ if (cell != NULL)
+ {
+ _gtk_cell_accessible_state_changed (cell, 0, GTK_CELL_RENDERER_FOCUSED);
+ g_signal_emit_by_name (accessible, "active-descendant-changed", cell);
+ }
+ }
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]