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
This commit is contained in:
Jonathan Blandford 2001-03-08 22:38:59 +00:00 committed by Jonathan Blandford
parent ce9d9a4a56
commit bd10a077cd
10 changed files with 88 additions and 49 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;
}