implement a working use_align = FALSE implementation (also mentioned in

Tue Dec 10 01:58:43 2002  Kristian Rietveld  <kris@gtk.org>

        * 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.
This commit is contained in:
Kristian Rietveld 2002-12-10 00:47:32 +00:00 committed by Kristian Rietveld
parent 2a455794b7
commit 5fb6d3b823
8 changed files with 175 additions and 8 deletions

View File

@ -1,3 +1,20 @@
Tue Dec 10 01:58:43 2002 Kristian Rietveld <kris@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkstyle.c (draw_spinbutton_shadow): Remove

View File

@ -1,3 +1,20 @@
Tue Dec 10 01:58:43 2002 Kristian Rietveld <kris@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkstyle.c (draw_spinbutton_shadow): Remove

View File

@ -1,3 +1,20 @@
Tue Dec 10 01:58:43 2002 Kristian Rietveld <kris@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkstyle.c (draw_spinbutton_shadow): Remove

View File

@ -1,3 +1,20 @@
Tue Dec 10 01:58:43 2002 Kristian Rietveld <kris@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkstyle.c (draw_spinbutton_shadow): Remove

View File

@ -1,3 +1,20 @@
Tue Dec 10 01:58:43 2002 Kristian Rietveld <kris@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkstyle.c (draw_spinbutton_shadow): Remove

View File

@ -1,3 +1,20 @@
Tue Dec 10 01:58:43 2002 Kristian Rietveld <kris@gtk.org>
* 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 <otaylor@redhat.com>
* gtk/gtkstyle.c (draw_spinbutton_shadow): Remove

View File

@ -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)

View File

@ -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))