treeview: Notify accessible about focus changes

This commit is contained in:
Benjamin Otte 2012-02-11 02:38:48 +01:00
parent a4559f1e19
commit f90ff5d50b
2 changed files with 21 additions and 0 deletions

View File

@ -2103,6 +2103,12 @@ _gtk_tree_view_accessible_add_state (GtkTreeView *treeview,
accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
if (state == GTK_CELL_RENDERER_FOCUSED)
{
/* will add later */
return;
}
for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
{
GtkCellAccessible *cell = peek_cell (accessible,
@ -2135,6 +2141,12 @@ _gtk_tree_view_accessible_remove_state (GtkTreeView *treeview,
accessible = GTK_TREE_VIEW_ACCESSIBLE (obj);
if (state == GTK_CELL_RENDERER_FOCUSED)
{
/* will add later */
return;
}
for (i = 0; i < gtk_tree_view_get_n_columns (treeview); i++)
{
GtkCellAccessible *cell = peek_cell (accessible,

View File

@ -13188,6 +13188,10 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
{
if (!(flags & CURSOR_INVALID) && tree_view->priv->cursor_node)
{
_gtk_tree_view_accessible_remove_state (tree_view,
tree_view->priv->cursor_tree,
tree_view->priv->cursor_node,
GTK_CELL_RENDERER_FOCUSED);
_gtk_tree_view_queue_draw_node (tree_view,
tree_view->priv->cursor_tree,
tree_view->priv->cursor_node,
@ -13250,6 +13254,11 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
tree_view->priv->cursor_node,
NULL);
}
_gtk_tree_view_accessible_add_state (tree_view,
tree_view->priv->cursor_tree,
tree_view->priv->cursor_node,
GTK_CELL_RENDERER_FOCUSED);
}
g_signal_emit (tree_view, tree_view_signals[CURSOR_CHANGED], 0);