rename last_single_clicked{,_2} to last_button_press{,_2}, as the latter

Fri Apr 19 16:30:09 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreeprivate.h, gtk/gtktreeview.c: rename
        last_single_clicked{,_2} to last_button_press{,_2}, as the latter
        is a more sane name.

        * gtk/gtktreeview.c (gtk_tree_view_button_press): use ->priv->anchor
        instead of ->priv->cursor, check for the anchor at another place, as
        you can go in edit mode without having an anchor.
This commit is contained in:
Kristian Rietveld 2002-04-19 14:31:54 +00:00 committed by Kristian Rietveld
parent 1f75708d5a
commit d3a1294923
8 changed files with 106 additions and 41 deletions

View File

@ -1,3 +1,13 @@
Fri Apr 19 16:30:09 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeprivate.h, gtk/gtktreeview.c: rename
last_single_clicked{,_2} to last_button_press{,_2}, as the latter
is a more sane name.
* gtk/gtktreeview.c (gtk_tree_view_button_press): use ->priv->anchor
instead of ->priv->cursor, check for the anchor at another place, as
you can go in edit mode without having an anchor.
2002-04-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkitemfactory.c:

View File

@ -1,3 +1,13 @@
Fri Apr 19 16:30:09 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeprivate.h, gtk/gtktreeview.c: rename
last_single_clicked{,_2} to last_button_press{,_2}, as the latter
is a more sane name.
* gtk/gtktreeview.c (gtk_tree_view_button_press): use ->priv->anchor
instead of ->priv->cursor, check for the anchor at another place, as
you can go in edit mode without having an anchor.
2002-04-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkitemfactory.c:

View File

@ -1,3 +1,13 @@
Fri Apr 19 16:30:09 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeprivate.h, gtk/gtktreeview.c: rename
last_single_clicked{,_2} to last_button_press{,_2}, as the latter
is a more sane name.
* gtk/gtktreeview.c (gtk_tree_view_button_press): use ->priv->anchor
instead of ->priv->cursor, check for the anchor at another place, as
you can go in edit mode without having an anchor.
2002-04-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkitemfactory.c:

View File

@ -1,3 +1,13 @@
Fri Apr 19 16:30:09 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeprivate.h, gtk/gtktreeview.c: rename
last_single_clicked{,_2} to last_button_press{,_2}, as the latter
is a more sane name.
* gtk/gtktreeview.c (gtk_tree_view_button_press): use ->priv->anchor
instead of ->priv->cursor, check for the anchor at another place, as
you can go in edit mode without having an anchor.
2002-04-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkitemfactory.c:

View File

@ -1,3 +1,13 @@
Fri Apr 19 16:30:09 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeprivate.h, gtk/gtktreeview.c: rename
last_single_clicked{,_2} to last_button_press{,_2}, as the latter
is a more sane name.
* gtk/gtktreeview.c (gtk_tree_view_button_press): use ->priv->anchor
instead of ->priv->cursor, check for the anchor at another place, as
you can go in edit mode without having an anchor.
2002-04-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkitemfactory.c:

View File

@ -1,3 +1,13 @@
Fri Apr 19 16:30:09 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeprivate.h, gtk/gtktreeview.c: rename
last_single_clicked{,_2} to last_button_press{,_2}, as the latter
is a more sane name.
* gtk/gtktreeview.c (gtk_tree_view_button_press): use ->priv->anchor
instead of ->priv->cursor, check for the anchor at another place, as
you can go in edit mode without having an anchor.
2002-04-18 Matthias Clasen <maclas@gmx.de>
* gtk/gtkitemfactory.c:

View File

@ -101,8 +101,8 @@ struct _GtkTreeViewPrivate
GdkWindow *drag_highlight_window;
GtkTreeViewColumn *drag_column;
GtkTreeRowReference *last_single_clicked;
GtkTreeRowReference *last_single_clicked_2;
GtkTreeRowReference *last_button_press;
GtkTreeRowReference *last_button_press_2;
/* bin_window offset */
GtkTreeRowReference *top_row;

View File

@ -1102,16 +1102,16 @@ gtk_tree_view_destroy (GtkObject *object)
tree_view->priv->drag_dest_row = NULL;
}
if (tree_view->priv->last_single_clicked != NULL)
if (tree_view->priv->last_button_press != NULL)
{
gtk_tree_row_reference_free (tree_view->priv->last_single_clicked);
tree_view->priv->last_single_clicked = NULL;
gtk_tree_row_reference_free (tree_view->priv->last_button_press);
tree_view->priv->last_button_press = NULL;
}
if (tree_view->priv->last_single_clicked_2 != NULL)
if (tree_view->priv->last_button_press_2 != NULL)
{
gtk_tree_row_reference_free (tree_view->priv->last_single_clicked_2);
tree_view->priv->last_single_clicked_2 = NULL;
gtk_tree_row_reference_free (tree_view->priv->last_button_press_2);
tree_view->priv->last_button_press_2 = NULL;
}
if (tree_view->priv->top_row != NULL)
@ -1790,20 +1790,25 @@ gtk_tree_view_button_press (GtkWidget *widget,
/* decide if we edit */
if (event->type == GDK_BUTTON_PRESS &&
!(event->state & gtk_accelerator_get_default_mod_mask ()) &&
tree_view->priv->cursor)
!(event->state & gtk_accelerator_get_default_mod_mask ()))
{
GtkTreePath *cursor = gtk_tree_row_reference_get_path (tree_view->priv->cursor);
GtkTreePath *anchor;
GtkTreeIter iter;
if (tree_view->priv->anchor)
{
anchor = gtk_tree_row_reference_get_path (tree_view->priv->anchor);
gtk_tree_model_get_iter (tree_view->priv->model, &iter, path);
gtk_tree_view_column_cell_set_cell_data (column,
tree_view->priv->model,
&iter,
GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_PARENT),
node->children?TRUE:FALSE);
}
else
anchor = NULL;
if ((cursor && !gtk_tree_path_compare (cursor, path))
if ((anchor && !gtk_tree_path_compare (anchor, path))
|| !_gtk_tree_view_column_has_editable_cell (column))
{
GtkCellEditable *cell_editable = NULL;
@ -1839,15 +1844,15 @@ gtk_tree_view_button_press (GtkWidget *widget,
(GdkEvent *)event,
flags);
gtk_tree_path_free (path);
gtk_tree_path_free (cursor);
gtk_tree_path_free (anchor);
return TRUE;
}
column_handled_click = TRUE;
}
g_free (path_string);
}
if (cursor)
gtk_tree_path_free (cursor);
if (anchor)
gtk_tree_path_free (anchor);
}
/* select */
@ -1890,18 +1895,18 @@ gtk_tree_view_button_press (GtkWidget *widget,
}
if (event->button == 1 && event->type == GDK_2BUTTON_PRESS &&
tree_view->priv->last_single_clicked)
tree_view->priv->last_button_press)
{
GtkTreePath *lsc;
lsc = gtk_tree_row_reference_get_path (tree_view->priv->last_single_clicked);
lsc = gtk_tree_row_reference_get_path (tree_view->priv->last_button_press);
if (tree_view->priv->last_single_clicked)
gtk_tree_row_reference_free (tree_view->priv->last_single_clicked);
if (tree_view->priv->last_single_clicked_2)
gtk_tree_row_reference_free (tree_view->priv->last_single_clicked_2);
tree_view->priv->last_single_clicked = NULL;
tree_view->priv->last_single_clicked_2 = NULL;
if (tree_view->priv->last_button_press)
gtk_tree_row_reference_free (tree_view->priv->last_button_press);
if (tree_view->priv->last_button_press_2)
gtk_tree_row_reference_free (tree_view->priv->last_button_press_2);
tree_view->priv->last_button_press = NULL;
tree_view->priv->last_button_press_2 = NULL;
if (lsc)
{
@ -1912,10 +1917,10 @@ gtk_tree_view_button_press (GtkWidget *widget,
}
else if (event->button == 1 && event->type == GDK_BUTTON_PRESS)
{
if (tree_view->priv->last_single_clicked)
gtk_tree_row_reference_free (tree_view->priv->last_single_clicked);
tree_view->priv->last_single_clicked = tree_view->priv->last_single_clicked_2;
tree_view->priv->last_single_clicked_2 = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->priv->model, path);
if (tree_view->priv->last_button_press)
gtk_tree_row_reference_free (tree_view->priv->last_button_press);
tree_view->priv->last_button_press = tree_view->priv->last_button_press_2;
tree_view->priv->last_button_press_2 = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->priv->model, path);
}
GTK_TREE_VIEW_UNSET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
@ -8871,24 +8876,24 @@ gtk_tree_view_real_collapse_row (GtkTreeView *tree_view,
gtk_tree_path_free (anchor_path);
}
if (gtk_tree_row_reference_valid (tree_view->priv->last_single_clicked))
if (gtk_tree_row_reference_valid (tree_view->priv->last_button_press))
{
GtkTreePath *lsc = gtk_tree_row_reference_get_path (tree_view->priv->last_single_clicked);
GtkTreePath *lsc = gtk_tree_row_reference_get_path (tree_view->priv->last_button_press);
if (gtk_tree_path_is_ancestor (path, lsc))
{
gtk_tree_row_reference_free (tree_view->priv->last_single_clicked);
tree_view->priv->last_single_clicked = NULL;
gtk_tree_row_reference_free (tree_view->priv->last_button_press);
tree_view->priv->last_button_press = NULL;
}
gtk_tree_path_free (lsc);
}
if (gtk_tree_row_reference_valid (tree_view->priv->last_single_clicked_2))
if (gtk_tree_row_reference_valid (tree_view->priv->last_button_press_2))
{
GtkTreePath *lsc = gtk_tree_row_reference_get_path (tree_view->priv->last_single_clicked_2);
GtkTreePath *lsc = gtk_tree_row_reference_get_path (tree_view->priv->last_button_press_2);
if (gtk_tree_path_is_ancestor (path, lsc))
{
gtk_tree_row_reference_free (tree_view->priv->last_single_clicked_2);
tree_view->priv->last_single_clicked_2 = NULL;
gtk_tree_row_reference_free (tree_view->priv->last_button_press_2);
tree_view->priv->last_button_press_2 = NULL;
}
gtk_tree_path_free (lsc);
}