From 61353c59dcb175818ce98d9b4c7706026edbf395 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 15 Apr 2001 13:03:26 +0000 Subject: Set "bold" argument on created tooltip. Adjusted position of displayed 2001-04-15 Christopher James Lahey * e-cell-text.c (ect_show_tooltip): Set "bold" argument on created tooltip. Adjusted position of displayed tooltip. * e-cell-tree.c (offset_of_node): Changed it so that this function handles knowing whether on not to indent non expandable first level nodes. This makes things more consistent. * e-table-item.c (eti_realize): Cleaned up the ETableItem code to properly hide tooltips when going off the screen. * e-table-tooltip.h: Added a visibility_count field to ETableTooltip. svn path=/trunk/; revision=9320 --- widgets/table/e-cell-tree.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'widgets/table/e-cell-tree.c') diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index fb9bbb511f..af5997eed1 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -82,7 +82,15 @@ visible_depth_of_node (ETableModel *model, int row) static gint offset_of_node (ETableModel *table_model, int row) { - return (visible_depth_of_node(table_model, row) + 1) * INDENT_AMOUNT; + ETreeModel *tree_model = e_cell_tree_get_tree_model(table_model, row); + ETreePath path = e_cell_tree_get_node(table_model, row); + + if (visible_depth_of_node (table_model, row) > 0 || + e_tree_model_node_is_expandable(tree_model, path)) { + return (visible_depth_of_node(table_model, row) + 1) * INDENT_AMOUNT; + } else { + return 0; + } } /* @@ -179,7 +187,6 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, gboolean selected; int offset, subcell_offset; - gboolean expanded, expandable; selected = flags & E_CELL_SELECTED; @@ -191,14 +198,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, node = e_cell_tree_get_node (ecell_view->e_table_model, row); - expandable = e_tree_model_node_is_expandable (tree_model, node); - expanded = e_tree_table_adapter_node_is_expanded (tree_table_adapter, node); - - if (visible_depth_of_node (ecell_view->e_table_model, row) > 0 || expandable) { - offset = offset_of_node (ecell_view->e_table_model, row); - } else { - offset = 0; - } + offset = offset_of_node (ecell_view->e_table_model, row); subcell_offset = offset; node_image = e_tree_model_icon_at (tree_model, node); @@ -272,11 +272,11 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, } /* now draw our icon if we're expandable */ - if (expandable) { + if (e_tree_model_node_is_expandable (tree_model, node)) { GdkPixbuf *image; int image_width, image_height; - image = (expanded + image = (e_tree_table_adapter_node_is_expanded (tree_table_adapter, node) ? E_CELL_TREE(tree_view->cell_view.ecell)->open_pixbuf : E_CELL_TREE(tree_view->cell_view.ecell)->closed_pixbuf); -- cgit