diff options
author | Jonathan Blandford <jrb@redhat.com> | 2001-03-08 22:38:59 +0000 |
---|---|---|
committer | Jonathan Blandford <jrb@src.gnome.org> | 2001-03-08 22:38:59 +0000 |
commit | bd10a077cd30cbcb9e4be5cd6215473a40dd0fcf (patch) | |
tree | 82cf883a61e21ec3319770dffa449959b01bf0a6 | |
parent | ce9d9a4a56ae14e8da30a346461bc243e5959eb8 (diff) | |
download | gdk-pixbuf-bd10a077cd30cbcb9e4be5cd6215473a40dd0fcf.tar.gz |
add support for invisible cells. (gtk_tree_view_bin_expose): ditto
Thu Mar 8 17:40:09 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): add
support for invisible cells.
(gtk_tree_view_bin_expose): ditto
also, forgot to commit tests/testtreeview.c last commit
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 6 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 6 | ||||
-rw-r--r-- | gtk/gtktreeprivate.h | 12 | ||||
-rw-r--r-- | gtk/gtktreeview.c | 73 | ||||
-rw-r--r-- | tests/testtreeview.c | 10 |
10 files changed, 88 insertions, 49 deletions
@@ -1,3 +1,9 @@ +Thu Mar 8 17:40:09 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): add + support for invisible cells. + (gtk_tree_view_bin_expose): ditto + Thu Mar 8 16:36:00 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (gtk_tree_model_get_type): add prerequesite diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index a8657af51..e85cbaadb 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,9 @@ +Thu Mar 8 17:40:09 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): add + support for invisible cells. + (gtk_tree_view_bin_expose): ditto + Thu Mar 8 16:36:00 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (gtk_tree_model_get_type): add prerequesite diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a8657af51..e85cbaadb 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +Thu Mar 8 17:40:09 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): add + support for invisible cells. + (gtk_tree_view_bin_expose): ditto + Thu Mar 8 16:36:00 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (gtk_tree_model_get_type): add prerequesite diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index a8657af51..e85cbaadb 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +Thu Mar 8 17:40:09 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): add + support for invisible cells. + (gtk_tree_view_bin_expose): ditto + Thu Mar 8 16:36:00 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (gtk_tree_model_get_type): add prerequesite diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index a8657af51..e85cbaadb 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +Thu Mar 8 17:40:09 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): add + support for invisible cells. + (gtk_tree_view_bin_expose): ditto + Thu Mar 8 16:36:00 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (gtk_tree_model_get_type): add prerequesite diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index a8657af51..e85cbaadb 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +Thu Mar 8 17:40:09 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): add + support for invisible cells. + (gtk_tree_view_bin_expose): ditto + Thu Mar 8 16:36:00 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (gtk_tree_model_get_type): add prerequesite diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index a8657af51..e85cbaadb 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +Thu Mar 8 17:40:09 2001 Jonathan Blandford <jrb@redhat.com> + + * gtk/gtktreeview.c (gtk_tree_view_create_row_drag_icon): add + support for invisible cells. + (gtk_tree_view_bin_expose): ditto + Thu Mar 8 16:36:00 2001 Jonathan Blandford <jrb@redhat.com> * gtk/gtktreemodel.c (gtk_tree_model_get_type): add prerequesite diff --git a/gtk/gtktreeprivate.h b/gtk/gtktreeprivate.h index 1ed5818ae..8d519c38c 100644 --- a/gtk/gtktreeprivate.h +++ b/gtk/gtktreeprivate.h @@ -40,7 +40,7 @@ extern "C" { * separator, the extra pixel by convention goes _below_ the row. So * a node in the rbtree owns TREE_VIEW_VERTICAL_SEPARATOR/2 pixels * above the row, and TREE_VIEW_VERTICAL_SEPARATOR/2 + - * TREE_VIEW_VERTICAL_SEPARATOR%2 pixels below the row. + * TREE_VIEW_VERTICAL_SEPARATOR%2 pixels below the row. */ #define TREE_VIEW_VERTICAL_SEPARATOR 2 @@ -89,7 +89,11 @@ struct _GtkTreeViewPrivate GdkWindow *header_window; gint expander_column; - + + /* Focus code */ + gboolean header_has_focus; + GList *focus_column; + /* Selection stuff */ GtkTreeRowReference *anchor; GtkTreeRowReference *cursor; @@ -114,12 +118,12 @@ struct _GtkTreeViewPrivate /* Scroll timeout (e.g. during dnd) */ guint scroll_timeout; - + /* Row drag-and-drop */ GtkTreeRowReference *drag_dest_row; GtkTreeViewDropPosition drag_dest_pos; guint open_dest_timeout; - + gint pressed_button; gint press_start_x; gint press_start_y; diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 04563be65..b5c12ddc1 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -315,8 +315,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) class->set_scroll_adjustments = gtk_tree_view_set_adjustments; -#if 0 - /* FIXME, tim needs to support interface prerequisits in GType */ g_object_class_install_property (o_class, PROP_MODEL, g_param_spec_object ("model", @@ -324,7 +322,6 @@ gtk_tree_view_class_init (GtkTreeViewClass *class) _("The model for the tree view"), GTK_TYPE_TREE_MODEL, G_PARAM_READWRITE)); -#endif g_object_class_install_property (o_class, PROP_HADJUSTMENT, @@ -407,7 +404,7 @@ gtk_tree_view_init (GtkTreeView *tree_view) tree_view->priv->selection = NULL; tree_view->priv->anchor = NULL; tree_view->priv->cursor = NULL; - + tree_view->priv->header_has_focus = FALSE; tree_view->priv->pressed_button = -1; tree_view->priv->press_start_x = -1; tree_view->priv->press_start_y = -1; @@ -1039,14 +1036,14 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view, cell_area.x += depth * tree_view->priv->tab_offset; cell_area.width -= depth * tree_view->priv->tab_offset; } - - gtk_cell_renderer_render (cell, - drawable, - widget, - &background_area, - &cell_area, - NULL, - 0); + if (cell->visible) + gtk_cell_renderer_render (cell, + drawable, + widget, + &background_area, + &cell_area, + NULL, + 0); cell_offset += column->displayed_width; } @@ -1280,14 +1277,15 @@ gtk_tree_view_bin_expose (GtkWidget *widget, * level of the tree we're dropping at. */ highlight_x = cell_area.x; - - gtk_cell_renderer_render (cell, - event->window, - widget, - &background_area, - &cell_area, - &event->area, - flags); + + if (cell->visible) + gtk_cell_renderer_render (cell, + event->window, + widget, + &background_area, + &cell_area, + &event->area, + flags); if ((node->flags & GTK_RBNODE_IS_PARENT) == GTK_RBNODE_IS_PARENT) { @@ -1300,14 +1298,15 @@ gtk_tree_view_bin_expose (GtkWidget *widget, } } else - { - gtk_cell_renderer_render (cell, - event->window, - widget, - &background_area, - &cell_area, - &event->area, - flags); + { + if (cell->visible) + gtk_cell_renderer_render (cell, + event->window, + widget, + &background_area, + &cell_area, + &event->area, + flags); } cell_offset += column->displayed_width; } @@ -1790,14 +1789,14 @@ gtk_tree_view_button_press (GtkWidget *widget, &iter); path_string = gtk_tree_path_to_string (path); - if (gtk_cell_renderer_event (cell, + if (cell->visible && + gtk_cell_renderer_event (cell, (GdkEvent *)event, widget, path_string, &background_area, &cell_area, 0)) - { g_free (path_string); gtk_tree_path_free (path); @@ -2028,14 +2027,11 @@ gtk_tree_view_focus_out (GtkWidget *widget, return FALSE; } -/* FIXME: It would be neat to someday make the headers a seperate widget that - * can be shared between various apps. Wishful thinking, though... - */ /* Returns TRUE if the focus is within the headers, after the focus operation is * done */ static gboolean -gtk_tree_view_header_focus (GtkTreeView *tree_view, +gtk_tree_view_header_focus (GtkTreeView *tree_view, GtkDirectionType dir) { GtkWidget *focus_child; @@ -2253,18 +2249,15 @@ gtk_tree_view_focus (GtkContainer *container, switch (direction) { case GTK_DIR_LEFT: - case GTK_DIR_TAB_BACKWARD: return (gtk_tree_view_header_focus (tree_view, direction)); + case GTK_DIR_TAB_BACKWARD: case GTK_DIR_UP: return FALSE; case GTK_DIR_TAB_FORWARD: + if (gtk_tree_view_header_focus (tree_view, direction)) + return TRUE; case GTK_DIR_RIGHT: case GTK_DIR_DOWN: - if (direction != GTK_DIR_DOWN) - { - if (gtk_tree_view_header_focus (tree_view, direction)) - return TRUE; - } GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS); gtk_widget_grab_focus (GTK_WIDGET (container)); diff --git a/tests/testtreeview.c b/tests/testtreeview.c index eea9d5c85..7a61d1633 100644 --- a/tests/testtreeview.c +++ b/tests/testtreeview.c @@ -600,7 +600,7 @@ create_tree_model (void) t[6], t[7], t[8]); i = 0; - while (i < G_TYPE_LAST_RESERVED_FUNDAMENTAL) + while (i < G_TYPE_RESERVED_LAST_FUNDAMENTAL) { typesystem_recurse (i, NULL, store); @@ -1095,7 +1095,7 @@ gtk_real_model_types_iter_next (GtkTreeModel *tree_model, if (parent == G_TYPE_INVALID) { /* fundamental type, add 1 */ - if ((type + 1) < G_TYPE_LAST_RESERVED_FUNDAMENTAL) + if ((type + 1) < G_TYPE_RESERVED_LAST_FUNDAMENTAL) { iter->user_data = GINT_TO_POINTER (type + 1); return TRUE; @@ -1183,7 +1183,7 @@ gtk_real_model_types_iter_n_children (GtkTreeModel *tree_model, { if (iter == NULL) { - return G_TYPE_LAST_RESERVED_FUNDAMENTAL - 1; + return G_TYPE_RESERVED_LAST_FUNDAMENTAL - 1; } else { @@ -1210,7 +1210,7 @@ gtk_real_model_types_iter_nth_child (GtkTreeModel *tree_model, if (parent == NULL) { /* fundamental type */ - if (n < G_TYPE_LAST_RESERVED_FUNDAMENTAL) + if (n < G_TYPE_RESERVED_LAST_FUNDAMENTAL) { iter->user_data = GINT_TO_POINTER (n); return TRUE; @@ -1258,7 +1258,7 @@ gtk_real_model_types_iter_parent (GtkTreeModel *tree_model, if (parent == G_TYPE_INVALID) { - if (type >= G_TYPE_LAST_RESERVED_FUNDAMENTAL) + if (type >= G_TYPE_RESERVED_LAST_FUNDAMENTAL) g_warning ("no parent for %d %s\n", type, g_type_name (type)); return FALSE; } |