[gtk+/treeview-refactor-staging: 1/5] Removing gtk_tree_view_move_focus_column() and only calling gtk_cell_area_focus()
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/treeview-refactor-staging: 1/5] Removing gtk_tree_view_move_focus_column() and only calling gtk_cell_area_focus()
- Date: Sun, 12 Dec 2010 11:35:52 +0000 (UTC)
commit 845a1b9796e51f5d136a5b6e4a2b649415d4d98e
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Dec 9 17:50:05 2010 +0900
Removing gtk_tree_view_move_focus_column() and only calling gtk_cell_area_focus()
This function did alot of nothing, gtk_cell_area_focus() simply returns whether
the focus stays in the area (column) or not, seems not to cause regressions to
just call it directly instead.
gtk/gtktreeview.c | 71 +++--------------------------------------------------
1 files changed, 4 insertions(+), 67 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 04055d5..46d0a70 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -10324,59 +10324,6 @@ cleanup:
gtk_tree_path_free (cursor_path);
}
-static gboolean
-gtk_tree_view_move_focus_column (GtkTreeView *tree_view,
- GtkTreeViewColumn *tree_column,
- gint count,
- gboolean left,
- gboolean right)
-{
- gboolean rtl;
- GtkDirectionType direction = 0;
- GtkCellArea *cell_area;
-
- rtl = gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL;
-
- switch (count)
- {
- case -1:
- direction = GTK_DIR_LEFT;
- break;
-
- case 1:
- direction = GTK_DIR_RIGHT;
- break;
- }
-
- cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (tree_column));
-
- /* if we are the current focus column and have multiple editable cells,
- * try to select the next one, else move the focus to the next column
- */
- if (tree_view->priv->focus_column == tree_column)
- {
- if (gtk_cell_area_focus (cell_area, direction))
- /* Focus stays in this column, so we are done */
- return TRUE;
-
- /* FIXME: RTL support for the following: */
- if (count == -1 && !left)
- {
- direction = GTK_DIR_RIGHT;
- gtk_cell_area_focus (cell_area, direction);
- }
- else if (count == 1 && !right)
- {
- direction = GTK_DIR_LEFT;
- gtk_cell_area_focus (cell_area, direction);
- }
-
- return FALSE;
- }
-
- return gtk_cell_area_focus (cell_area, direction);
-}
-
static void
gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view,
gint count)
@@ -10390,6 +10337,7 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view,
gboolean found_column = FALSE;
gboolean rtl;
GtkDirectionType direction;
+ GtkCellArea *cell_area;
rtl = (gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL);
@@ -10434,8 +10382,6 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view,
while (list)
{
- gboolean left, right;
-
column = list->data;
if (gtk_tree_view_column_get_visible (column) == FALSE)
goto loop_end;
@@ -10446,23 +10392,14 @@ gtk_tree_view_move_cursor_left_right (GtkTreeView *tree_view,
GTK_RBNODE_FLAG_SET (cursor_node, GTK_RBNODE_IS_PARENT),
cursor_node->children?TRUE:FALSE);
- if (rtl)
- {
- right = list->prev ? TRUE : FALSE;
- left = list->next ? TRUE : FALSE;
- }
- else
- {
- left = list->prev ? TRUE : FALSE;
- right = list->next ? TRUE : FALSE;
-
- }
- if (gtk_tree_view_move_focus_column (tree_view, column, count, left, right))
+ cell_area = gtk_cell_layout_get_area (GTK_CELL_LAYOUT (column));
+ if (gtk_cell_area_focus (cell_area, direction))
{
tree_view->priv->focus_column = column;
found_column = TRUE;
break;
}
+
loop_end:
if (count == 1)
list = rtl ? list->prev : list->next;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]