This commit lands the 'dy patch'.

Sun Feb 17 00:13:06 2002  Kristian Rietveld  <kris@gtk.org>

        This commit lands the 'dy patch'.

        * gtk/gtktreeview.c (validate_rows_handler): update top_row or dy,
        (gtk_tree_view_top_row_to_dy): new function,
        (gtk_tree_view_row_changed): update top_row or dy,
        (gtk_tree_view_rows_reordered): update top_row
This commit is contained in:
Kristian Rietveld 2002-02-16 23:13:37 +00:00 committed by Kristian Rietveld
parent 21ac424e41
commit 554838e4f6
8 changed files with 121 additions and 0 deletions

View File

@ -1,3 +1,12 @@
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
* gtk/gtktreeview.c (validate_rows_handler): update top_row or dy,
(gtk_tree_view_top_row_to_dy): new function,
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example

View File

@ -1,3 +1,12 @@
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
* gtk/gtktreeview.c (validate_rows_handler): update top_row or dy,
(gtk_tree_view_top_row_to_dy): new function,
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example

View File

@ -1,3 +1,12 @@
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
* gtk/gtktreeview.c (validate_rows_handler): update top_row or dy,
(gtk_tree_view_top_row_to_dy): new function,
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example

View File

@ -1,3 +1,12 @@
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
* gtk/gtktreeview.c (validate_rows_handler): update top_row or dy,
(gtk_tree_view_top_row_to_dy): new function,
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example

View File

@ -1,3 +1,12 @@
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
* gtk/gtktreeview.c (validate_rows_handler): update top_row or dy,
(gtk_tree_view_top_row_to_dy): new function,
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example

View File

@ -1,3 +1,12 @@
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
* gtk/gtktreeview.c (validate_rows_handler): update top_row or dy,
(gtk_tree_view_top_row_to_dy): new function,
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example

View File

@ -1,3 +1,12 @@
Sun Feb 17 00:13:06 2002 Kristian Rietveld <kris@gtk.org>
This commit lands the 'dy patch'.
* gtk/gtktreeview.c (validate_rows_handler): update top_row or dy,
(gtk_tree_view_top_row_to_dy): new function,
(gtk_tree_view_row_changed): update top_row or dy,
(gtk_tree_view_rows_reordered): update top_row
2002-02-16 Matthias Clasen <matthias@YAST_ASK>
* examples/extract.awk: rearrange rules to not emit the example

View File

@ -264,6 +264,7 @@ static gboolean validate_rows_handler (GtkTreeView *tree_view);
static gboolean presize_handler_callback (gpointer data);
static void install_presize_handler (GtkTreeView *tree_view);
static void gtk_tree_view_dy_to_top_row (GtkTreeView *tree_view);
static void gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view);
/* Internal functions */
@ -3455,6 +3456,11 @@ validate_rows_handler (GtkTreeView *tree_view)
while (i < GTK_TREE_VIEW_NUM_ROWS_PER_IDLE);
done:
if (gtk_tree_row_reference_valid (tree_view->priv->top_row))
gtk_tree_view_top_row_to_dy (tree_view);
else
gtk_tree_view_dy_to_top_row (tree_view);
if (path) gtk_tree_path_free (path);
if (validated_area)
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
@ -3534,6 +3540,51 @@ gtk_tree_view_dy_to_top_row (GtkTreeView *tree_view)
gtk_tree_path_free (path);
}
static void
gtk_tree_view_top_row_to_dy (GtkTreeView *tree_view)
{
GtkTreePath *path;
GtkRBTree *tree;
GtkRBNode *node;
if (tree_view->priv->top_row)
path = gtk_tree_row_reference_get_path (tree_view->priv->top_row);
else
path = NULL;
if (!path)
tree = NULL;
else
_gtk_tree_view_find_node (tree_view, path, &tree, &node);
if (path)
gtk_tree_path_free (path);
if (tree == NULL)
{
/* keep dy and set new toprow */
gtk_tree_row_reference_free (tree_view->priv->top_row);
tree_view->priv->top_row = NULL;
tree_view->priv->top_row_dy = 0;
gtk_tree_view_dy_to_top_row (tree_view);
return;
}
if (MAX (BACKGROUND_HEIGHT (node), tree_view->priv->expander_size)
< tree_view->priv->top_row_dy)
{
/* new top row */
gtk_tree_view_dy_to_top_row (tree_view);
return;
}
tree_view->priv->dy = _gtk_rbtree_node_find_offset (tree, node);
tree_view->priv->dy += tree_view->priv->top_row_dy;
gtk_adjustment_set_value (tree_view->priv->vadjustment,
tree_view->priv->dy);
gtk_adjustment_changed (tree_view->priv->vadjustment);
}
void
_gtk_tree_view_install_mark_rows_col_dirty (GtkTreeView *tree_view)
{
@ -5222,6 +5273,11 @@ gtk_tree_view_row_deleted (GtkTreeModel *model,
_gtk_rbtree_remove_node (tree, node);
}
if (gtk_tree_row_reference_valid (tree_view->priv->top_row))
gtk_tree_view_top_row_to_dy (tree_view);
else
gtk_tree_view_dy_to_top_row (tree_view);
gtk_widget_queue_resize (GTK_WIDGET (tree_view));
if (selection_changed)
@ -5272,6 +5328,8 @@ gtk_tree_view_rows_reordered (GtkTreeModel *model,
_gtk_rbtree_reorder (tree, new_order, len);
gtk_widget_queue_draw (GTK_WIDGET (tree_view));
gtk_tree_view_dy_to_top_row (tree_view);
}