]> Pileus Git - ~andy/gtk/commitdiff
a11y: Remove "toggle" action from cell renderers
authorBenjamin Otte <otte@redhat.com>
Mon, 12 Dec 2011 12:26:15 +0000 (13:26 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 16 Dec 2011 03:53:14 +0000 (04:53 +0100)
This is identical to "edit" (even though that name is kinda confusing).

gtk/a11y/gtktreeviewaccessible.c

index 8eeaa3fb49b1bea2487e6c02b5595ba645e77803..cc63fbb1fabe71724d2a0100b1b6425101a3ac26 100644 (file)
@@ -84,7 +84,6 @@ static void             set_cell_expandable             (GtkCellAccessible     *
 static void             add_cell_actions                (GtkCellAccessible     *cell,
                                                          gboolean               editable);
 
-static void             toggle_cell_toggled             (GtkCellAccessible     *cell);
 static void             edit_cell                       (GtkCellAccessible     *cell);
 static void             activate_cell                   (GtkCellAccessible     *cell);
 static void             cell_destroyed                  (gpointer               data);
@@ -2209,10 +2208,6 @@ static void
 add_cell_actions (GtkCellAccessible *cell,
                   gboolean           editable)
 {
-  if (GTK_IS_BOOLEAN_CELL_ACCESSIBLE (cell))
-    _gtk_cell_accessible_add_action (cell,
-                                     "toggle", "toggles the cell",
-                                     NULL, toggle_cell_toggled);
   if (editable)
     _gtk_cell_accessible_add_action (cell,
                                      "edit", "creates a widget in which the contents of the cell can be edited",
@@ -2253,52 +2248,6 @@ toggle_cell_expanded (GtkCellAccessible *cell)
   gtk_tree_path_free (path);
 }
 
-static void
-toggle_cell_toggled (GtkCellAccessible *cell)
-{
-  GtkTreeViewAccessibleCellInfo *cell_info;
-  GtkTreePath *path;
-  gchar *pathstring;
-  GList *renderers, *cur_renderer;
-  AtkObject *parent;
-  gboolean is_container_cell = FALSE;
-
-  parent = atk_object_get_parent (ATK_OBJECT (cell));
-  if (GTK_IS_CONTAINER_CELL_ACCESSIBLE (parent))
-    {
-      is_container_cell = TRUE;
-      parent = atk_object_get_parent (parent);
-    }
-
-  cell_info = find_cell_info (GTK_TREE_VIEW_ACCESSIBLE (parent), cell);
-  if (!cell_info)
-    return;
-
-  path = cell_info_get_path (cell_info);
-  if (!path)
-    return;
-
-  /* If the cell is in a container, its index is used to find the
-   * renderer in the list. Otherwise, we assume that the cell is
-   * represented by the first renderer in the list
-   */
-  renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (cell_info->cell_col_ref));
-  if (is_container_cell)
-    cur_renderer = g_list_nth (renderers, atk_object_get_index_in_parent (ATK_OBJECT (cell)));
-  else
-    cur_renderer = renderers;
-
-  if (cur_renderer)
-    {
-      pathstring = gtk_tree_path_to_string (path);
-      g_signal_emit_by_name (cur_renderer->data, "toggled", pathstring);
-      g_free (pathstring);
-    }
-
-  g_list_free (renderers);
-  gtk_tree_path_free (path);
-}
-
 static void
 edit_cell (GtkCellAccessible *cell)
 {