diff --git a/ChangeLog b/ChangeLog index 670b29db47..ec07ed52be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +Tue Dec 10 01:58:43 2002 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): implement a working + use_align = FALSE implementation (also mentioned in #91335, reported + by Juri Pakaste). + + * gtk/gtktreeview.c (validate_visible_area): only free the + scroll_to_path if we are done with validating (fixes #93584, reported + and testcase provided by Erik Simonsen). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action): + set the GTK_CELL_RENDERER_FOCUSED flag where appropriate. (fixes + #75745, reported by Richard Hult). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_get_position): + initialize cellinfo to NULL to silence the compiler. + Mon Dec 9 19:31:59 2002 Owen Taylor * gtk/gtkstyle.c (draw_spinbutton_shadow): Remove diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 670b29db47..ec07ed52be 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,20 @@ +Tue Dec 10 01:58:43 2002 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): implement a working + use_align = FALSE implementation (also mentioned in #91335, reported + by Juri Pakaste). + + * gtk/gtktreeview.c (validate_visible_area): only free the + scroll_to_path if we are done with validating (fixes #93584, reported + and testcase provided by Erik Simonsen). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action): + set the GTK_CELL_RENDERER_FOCUSED flag where appropriate. (fixes + #75745, reported by Richard Hult). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_get_position): + initialize cellinfo to NULL to silence the compiler. + Mon Dec 9 19:31:59 2002 Owen Taylor * gtk/gtkstyle.c (draw_spinbutton_shadow): Remove diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 670b29db47..ec07ed52be 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,20 @@ +Tue Dec 10 01:58:43 2002 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): implement a working + use_align = FALSE implementation (also mentioned in #91335, reported + by Juri Pakaste). + + * gtk/gtktreeview.c (validate_visible_area): only free the + scroll_to_path if we are done with validating (fixes #93584, reported + and testcase provided by Erik Simonsen). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action): + set the GTK_CELL_RENDERER_FOCUSED flag where appropriate. (fixes + #75745, reported by Richard Hult). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_get_position): + initialize cellinfo to NULL to silence the compiler. + Mon Dec 9 19:31:59 2002 Owen Taylor * gtk/gtkstyle.c (draw_spinbutton_shadow): Remove diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 670b29db47..ec07ed52be 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,20 @@ +Tue Dec 10 01:58:43 2002 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): implement a working + use_align = FALSE implementation (also mentioned in #91335, reported + by Juri Pakaste). + + * gtk/gtktreeview.c (validate_visible_area): only free the + scroll_to_path if we are done with validating (fixes #93584, reported + and testcase provided by Erik Simonsen). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action): + set the GTK_CELL_RENDERER_FOCUSED flag where appropriate. (fixes + #75745, reported by Richard Hult). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_get_position): + initialize cellinfo to NULL to silence the compiler. + Mon Dec 9 19:31:59 2002 Owen Taylor * gtk/gtkstyle.c (draw_spinbutton_shadow): Remove diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 670b29db47..ec07ed52be 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,20 @@ +Tue Dec 10 01:58:43 2002 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): implement a working + use_align = FALSE implementation (also mentioned in #91335, reported + by Juri Pakaste). + + * gtk/gtktreeview.c (validate_visible_area): only free the + scroll_to_path if we are done with validating (fixes #93584, reported + and testcase provided by Erik Simonsen). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action): + set the GTK_CELL_RENDERER_FOCUSED flag where appropriate. (fixes + #75745, reported by Richard Hult). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_get_position): + initialize cellinfo to NULL to silence the compiler. + Mon Dec 9 19:31:59 2002 Owen Taylor * gtk/gtkstyle.c (draw_spinbutton_shadow): Remove diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 670b29db47..ec07ed52be 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,20 @@ +Tue Dec 10 01:58:43 2002 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): implement a working + use_align = FALSE implementation (also mentioned in #91335, reported + by Juri Pakaste). + + * gtk/gtktreeview.c (validate_visible_area): only free the + scroll_to_path if we are done with validating (fixes #93584, reported + and testcase provided by Erik Simonsen). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_process_action): + set the GTK_CELL_RENDERER_FOCUSED flag where appropriate. (fixes + #75745, reported by Richard Hult). + + * gtk/gtktreeviewcolumn.c (gtk_tree_view_column_cell_get_position): + initialize cellinfo to NULL to silence the compiler. + Mon Dec 9 19:31:59 2002 Owen Taylor * gtk/gtkstyle.c (draw_spinbutton_shadow): Remove diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index b42dac1195..9569a2a849 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -3873,6 +3873,7 @@ validate_visible_area (GtkTreeView *tree_view) if (validate_row (tree_view, tree, node, &iter, path)) size_changed = TRUE; } + if (tree_view->priv->scroll_to_use_align) { gint height = MAX (GTK_RBNODE_GET_HEIGHT (node), tree_view->priv->expander_size); @@ -3884,11 +3885,54 @@ validate_visible_area (GtkTreeView *tree_view) } else { - /* FIXME: temporary solution, just validate a complete height - * and all will be fine... + /* two cases: + * 1) row not visible + * 2) row visible */ - area_above = total_height; - area_below = total_height; + gint dy; + gint height = MAX (GTK_RBNODE_GET_HEIGHT (node), tree_view->priv->expander_size); + + dy = _gtk_rbtree_node_find_offset (tree, node); + + if (dy >= tree_view->priv->vadjustment->value && + dy <= (tree_view->priv->vadjustment->value + + tree_view->priv->vadjustment->page_size)) + { + /* row visible: keep the row at the same position */ + area_above = dy - tree_view->priv->vadjustment->value; + area_below = (tree_view->priv->vadjustment->value + + tree_view->priv->vadjustment->page_size) + - dy - height; + } + else + { + /* row not visible */ + if (dy >= 0 && dy <= tree_view->priv->vadjustment->page_size) + { + /* row at the beginning -- fixed */ + area_above = dy; + area_below = tree_view->priv->vadjustment->page_size + - dy - height; + } + else if (dy >= (tree_view->priv->vadjustment->upper - + tree_view->priv->vadjustment->page_size) + && dy <= tree_view->priv->vadjustment->upper) + { + /* row at the end -- fixed */ + area_above = dy - (tree_view->priv->vadjustment->upper - + tree_view->priv->vadjustment->page_size); + area_below = tree_view->priv->vadjustment->upper - + dy - height; + } + else + { + /* row somewhere in the middle, bring it to the top + * of the view + */ + area_above = 0; + area_above = total_height - height; + } + } } } else @@ -4049,6 +4093,7 @@ validate_visible_area (GtkTreeView *tree_view) if (size_changed) { GtkRequisition requisition; + /* We temporarily guess a size, under the assumption that it will be the * same when we get our next size_allocate. If we don't do this, we'll be * in an inconsistent state if we call top_row_to_dy. */ @@ -4060,7 +4105,8 @@ validate_visible_area (GtkTreeView *tree_view) } /* if we scroll at all, always update dy and kill the top_row */ - if (tree_view->priv->scroll_to_path) + if (tree_view->priv->scroll_to_path && + ! GTK_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_RBNODE_DESCENDANTS_INVALID)) { update_dy = TRUE; if (tree_view->priv->top_row) diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c index 1ca07088ad..3f4dbd642d 100644 --- a/gtk/gtktreeviewcolumn.c +++ b/gtk/gtktreeviewcolumn.c @@ -2482,6 +2482,9 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column, if (! info->cell->visible) continue; + if (info->has_focus) + flags |= GTK_CELL_RENDERER_FOCUSED; + real_background_area.width = info->requested_width + (info->expand?extra_space:0); info->real_width = real_background_area.width; @@ -2573,7 +2576,10 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column, background_area, cell_area, flags)) - return TRUE; + { + flags &= ~GTK_CELL_RENDERER_FOCUSED; + return TRUE; + } } else if (visible && mode == GTK_CELL_RENDERER_MODE_EDITABLE) { @@ -2592,12 +2598,16 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column, info->in_editing_mode = TRUE; gtk_tree_view_column_focus_cell (tree_column, info->cell); + flags &= ~GTK_CELL_RENDERER_FOCUSED; + return TRUE; } } } } + flags &= ~GTK_CELL_RENDERER_FOCUSED; + real_cell_area.x += (info->real_width + tree_column->spacing); real_background_area.x += (info->real_width + tree_column->spacing); } @@ -2613,6 +2623,9 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column, if (! info->cell->visible) continue; + if (info->has_focus) + flags |= GTK_CELL_RENDERER_FOCUSED; + real_background_area.width = info->requested_width + (info->expand?extra_space:0); info->real_width = real_background_area.width; @@ -2704,7 +2717,10 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column, background_area, cell_area, flags)) - return TRUE; + { + flags &= ~GTK_CELL_RENDERER_FOCUSED; + return TRUE; + } } else if (visible && mode == GTK_CELL_RENDERER_MODE_EDITABLE) { @@ -2723,12 +2739,15 @@ gtk_tree_view_column_cell_process_action (GtkTreeViewColumn *tree_column, info->in_editing_mode = TRUE; gtk_tree_view_column_focus_cell (tree_column, info->cell); + flags &= ~GTK_CELL_RENDERER_FOCUSED; return TRUE; } } } } + flags &= ~GTK_CELL_RENDERER_FOCUSED; + real_cell_area.x += (info->real_width + tree_column->spacing); real_background_area.x += (info->real_width + tree_column->spacing); } @@ -3279,7 +3298,7 @@ gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column, GList *list; gint current_x = 0; gboolean found_cell = FALSE; - GtkTreeViewColumnCellInfo *cellinfo; + GtkTreeViewColumnCellInfo *cellinfo = NULL; list = gtk_tree_view_column_cell_first (tree_column); for (; list; list = gtk_tree_view_column_cell_next (tree_column, list))