Commit 58ed9e8b authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

change scroll_to_cell delayed code to happen in size_allocate.

Mon Oct  1 14:07:02 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtktreeview.c (gtk_tree_view_size_allocate): change
	scroll_to_cell delayed code to happen in size_allocate.

	* gtk/gtkstyle.c (gtk_default_draw_expander): change
	prelight/normal arrow drawing.

	* gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate

	* gtk/gtktreestore.c: refactor.
parent c6f15f38
Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): change
scroll_to_cell delayed code to happen in size_allocate.
* gtk/gtkstyle.c (gtk_default_draw_expander): change
prelight/normal arrow drawing.
* gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate
* gtk/gtktreestore.c: refactor.
Sun Sep 30 22:15:52 2001 Manish Singh <yosh@gimp.org>
* gtk/gtkcheckbutton.c (gtk_check_button_size_allocate): Applied
......
Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): change
scroll_to_cell delayed code to happen in size_allocate.
* gtk/gtkstyle.c (gtk_default_draw_expander): change
prelight/normal arrow drawing.
* gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate
* gtk/gtktreestore.c: refactor.
Sun Sep 30 22:15:52 2001 Manish Singh <yosh@gimp.org>
* gtk/gtkcheckbutton.c (gtk_check_button_size_allocate): Applied
......
Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): change
scroll_to_cell delayed code to happen in size_allocate.
* gtk/gtkstyle.c (gtk_default_draw_expander): change
prelight/normal arrow drawing.
* gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate
* gtk/gtktreestore.c: refactor.
Sun Sep 30 22:15:52 2001 Manish Singh <yosh@gimp.org>
* gtk/gtkcheckbutton.c (gtk_check_button_size_allocate): Applied
......
Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): change
scroll_to_cell delayed code to happen in size_allocate.
* gtk/gtkstyle.c (gtk_default_draw_expander): change
prelight/normal arrow drawing.
* gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate
* gtk/gtktreestore.c: refactor.
Sun Sep 30 22:15:52 2001 Manish Singh <yosh@gimp.org>
* gtk/gtkcheckbutton.c (gtk_check_button_size_allocate): Applied
......
Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): change
scroll_to_cell delayed code to happen in size_allocate.
* gtk/gtkstyle.c (gtk_default_draw_expander): change
prelight/normal arrow drawing.
* gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate
* gtk/gtktreestore.c: refactor.
Sun Sep 30 22:15:52 2001 Manish Singh <yosh@gimp.org>
* gtk/gtkcheckbutton.c (gtk_check_button_size_allocate): Applied
......
Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): change
scroll_to_cell delayed code to happen in size_allocate.
* gtk/gtkstyle.c (gtk_default_draw_expander): change
prelight/normal arrow drawing.
* gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate
* gtk/gtktreestore.c: refactor.
Sun Sep 30 22:15:52 2001 Manish Singh <yosh@gimp.org>
* gtk/gtkcheckbutton.c (gtk_check_button_size_allocate): Applied
......
Mon Oct 1 14:07:02 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): change
scroll_to_cell delayed code to happen in size_allocate.
* gtk/gtkstyle.c (gtk_default_draw_expander): change
prelight/normal arrow drawing.
* gtk/gtktreedatalist.c: Change compare func to use g_utf8_collate
* gtk/gtktreestore.c: refactor.
Sun Sep 30 22:15:52 2001 Manish Singh <yosh@gimp.org>
* gtk/gtkcheckbutton.c (gtk_check_button_size_allocate): Applied
......
......@@ -777,6 +777,13 @@ GtkTreeView
@arg1:
@arg2:
<!-- ##### SIGNAL GtkTreeView::select-all ##### -->
<para>
</para>
@treeview: the object which received the signal.
<!-- ##### SIGNAL GtkTreeView::select-cursor-parent ##### -->
<para>
......@@ -790,6 +797,7 @@ GtkTreeView
</para>
@treeview: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GtkTreeView::set-scroll-adjustments ##### -->
<para>
......
......@@ -528,7 +528,7 @@ _gtk_rbtree_remove (GtkRBTree *tree)
}
tmp_tree = tree->parent_tree;
tmp_node = tree->parent_node;
_gtk_rbtree_free (tree);
if (gtk_debug_flags & GTK_DEBUG_TREE)
......
......@@ -4057,10 +4057,8 @@ gtk_default_draw_expander (GtkStyle *style,
if (state_type == GTK_STATE_PRELIGHT)
{
gdk_draw_polygon (window, style->base_gc[GTK_STATE_NORMAL],
TRUE, points, 3);
gdk_draw_polygon (window, style->fg_gc[GTK_STATE_NORMAL],
FALSE, points, 3);
TRUE, points, 3);
}
else if (state_type == GTK_STATE_ACTIVE)
{
......@@ -4071,8 +4069,10 @@ gtk_default_draw_expander (GtkStyle *style,
}
else
{
gdk_draw_polygon (window, style->fg_gc[GTK_STATE_NORMAL],
gdk_draw_polygon (window, style->base_gc[GTK_STATE_NORMAL],
TRUE, points, 3);
gdk_draw_polygon (window, style->fg_gc[GTK_STATE_NORMAL],
FALSE, points, 3);
}
if (area)
{
......
......@@ -303,11 +303,9 @@ gtk_tree_data_list_compare_func (GtkTreeModel *model,
case G_TYPE_STRING:
stra = g_value_get_string (&a_value);
strb = g_value_get_string (&b_value);
if (stra == NULL)
stra = "";
if (strb == NULL)
strb = "";
retval = strcmp (stra, strb);
if (stra == NULL) stra = "";
if (strb == NULL) strb = "";
retval = g_utf8_collate (stra, strb);
break;
case G_TYPE_POINTER:
case G_TYPE_BOXED:
......
......@@ -1213,25 +1213,29 @@ gtk_tree_row_ref_inserted_callback (GObject *object,
{
GtkTreeRowReference *reference = tmp_list->data;
if (reference->path)
if (reference->path == NULL)
goto done;
if (reference->path->depth >= path->depth)
{
gint depth = gtk_tree_path_get_depth (path);
gint ref_depth = gtk_tree_path_get_depth (reference->path);
gint i;
gboolean ancestor = TRUE;
if (ref_depth >= depth)
for (i = 0; i < path->depth - 1; i ++)
{
gint *indices = gtk_tree_path_get_indices (path);
gint *ref_indices = gtk_tree_path_get_indices (reference->path);
gint i;
/* This is the depth that might affect us. */
i = depth - 1;
if (indices[i] <= ref_indices[i])
ref_indices[i] += 1;
if (path->indices[i] != reference->path->indices[i])
{
ancestor = FALSE;
break;
}
}
}
if (ancestor == FALSE)
goto done;
if (path->indices[path->depth-1] <= reference->path->indices[path->depth-1])
reference->path->indices[path->depth-1] += 1;
}
done:
tmp_list = g_slist_next (tmp_list);
}
}
......@@ -1266,30 +1270,15 @@ gtk_tree_row_ref_deleted_callback (GObject *object,
if (reference->path)
{
gint depth = gtk_tree_path_get_depth (path);
gint ref_depth = gtk_tree_path_get_depth (reference->path);
if (ref_depth >= depth)
if (gtk_tree_path_is_ancestor (path, reference->path))
{
/* Need to adjust path upward */
gint *indices = gtk_tree_path_get_indices (path);
gint *ref_indices = gtk_tree_path_get_indices (reference->path);
gint i;
i = depth - 1;
if (indices[i] < ref_indices[i])
ref_indices[i] -= 1;
else if (indices[i] == ref_indices[i])
{
/* the referenced node itself, or its parent, was
* deleted, mark invalid
*/
gtk_tree_path_free (reference->path);
reference->path = NULL;
}
reference->path->indices[path->depth-1]-=1;
}
else if (gtk_tree_path_compare (path, reference->path) == 0)
{
gtk_tree_path_free (reference->path);
reference->path = NULL;
}
}
tmp_list = g_slist_next (tmp_list);
}
......
......@@ -1179,23 +1179,20 @@ gtk_tree_store_prepend (GtkTreeStore *tree_store,
if (parent_node->children == NULL)
{
GtkTreePath *path;
iter->stamp = tree_store->stamp;
iter->user_data = g_node_new (NULL);
g_node_prepend (parent_node, iter->user_data);
path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), iter);
gtk_tree_model_row_inserted (GTK_TREE_MODEL (tree_store), path, iter);
if (parent_node != tree_store->root)
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), parent);
gtk_tree_path_up (path);
gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (tree_store), path, parent);
gtk_tree_path_append_index (path, 0);
}
else
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), iter);
}
gtk_tree_model_row_inserted (GTK_TREE_MODEL (tree_store), path, iter);
gtk_tree_path_free (path);
}
else
......@@ -1245,18 +1242,14 @@ gtk_tree_store_append (GtkTreeStore *tree_store,
g_node_append (parent_node, G_NODE (iter->user_data));
path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), iter);
gtk_tree_model_row_inserted (GTK_TREE_MODEL (tree_store), path, iter);
if (parent_node != tree_store->root)
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), parent);
gtk_tree_path_up (path);
gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (tree_store), path, parent);
gtk_tree_path_append_index (path, 0);
}
else
{
path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), iter);
}
gtk_tree_model_row_inserted (GTK_TREE_MODEL (tree_store), path, iter);
gtk_tree_path_free (path);
}
else
......
......@@ -1262,24 +1262,7 @@ gtk_tree_view_realize (GtkWidget *widget)
_gtk_tree_view_update_size (GTK_TREE_VIEW (widget));
if (tree_view->priv->scroll_to_path != NULL ||
tree_view->priv->scroll_to_column != NULL)
{
gtk_tree_view_scroll_to_cell (tree_view,
tree_view->priv->scroll_to_path,
tree_view->priv->scroll_to_column,
tree_view->priv->scroll_to_use_align,
tree_view->priv->scroll_to_row_align,
tree_view->priv->scroll_to_col_align);
if (tree_view->priv->scroll_to_path)
{
gtk_tree_path_free (tree_view->priv->scroll_to_path);
tree_view->priv->scroll_to_path = NULL;
}
tree_view->priv->scroll_to_column = NULL;
}
if (GTK_WIDGET_CLASS (parent_class)->map)
if (GTK_WIDGET_CLASS (parent_class)->map)
(* GTK_WIDGET_CLASS (parent_class)->map) (widget);
}
......@@ -1518,6 +1501,23 @@ gtk_tree_view_size_allocate (GtkWidget *widget,
gtk_signal_emit_by_name (GTK_OBJECT (tree_view->priv->vadjustment), "changed");
if (tree_view->priv->scroll_to_path != NULL ||
tree_view->priv->scroll_to_column != NULL)
{
gtk_tree_view_scroll_to_cell (tree_view,
tree_view->priv->scroll_to_path,
tree_view->priv->scroll_to_column,
tree_view->priv->scroll_to_use_align,
tree_view->priv->scroll_to_row_align,
tree_view->priv->scroll_to_col_align);
if (tree_view->priv->scroll_to_path)
{
gtk_tree_path_free (tree_view->priv->scroll_to_path);
tree_view->priv->scroll_to_path = NULL;
}
tree_view->priv->scroll_to_column = NULL;
}
}
static gboolean
......@@ -4401,7 +4401,6 @@ gtk_tree_view_row_inserted (GtkTreeModel *model,
/* Update all row-references */
gtk_tree_row_reference_inserted (G_OBJECT (data), path);
depth = gtk_tree_path_get_depth (path);
indices = gtk_tree_path_get_indices (path);
......@@ -6067,13 +6066,14 @@ gtk_tree_view_real_expand_collapse_cursor_row (GtkTreeView *tree_view,
if (cursor_path == NULL)
return;
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
gtk_tree_view_queue_draw_path (tree_view, cursor_path, NULL);
if (expand)
gtk_tree_view_expand_row (tree_view, cursor_path, open_all);
else
gtk_tree_view_collapse_row (tree_view, cursor_path);
gtk_widget_grab_focus (GTK_WIDGET (tree_view));
gtk_tree_view_queue_draw_path (tree_view, cursor_path, NULL);
gtk_tree_path_free (cursor_path);
}
......@@ -7466,6 +7466,7 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view,
GtkTreeIter temp;
gboolean expand;
if (node->children)
return TRUE;
......@@ -7513,7 +7514,6 @@ gtk_tree_view_real_expand_row (GtkTreeView *tree_view,
}
g_signal_emit (G_OBJECT (tree_view), tree_view_signals[ROW_EXPANDED], 0, &iter, path);
return TRUE;
}
......@@ -7914,7 +7914,7 @@ gtk_tree_view_real_set_cursor (GtkTreeView *tree_view,
* @tree_view: A #GtkTreeView
* @path: A pointer to be filled with the current cursor path, or %NULL
* @focus_column: A pointer to be filled with the current focus column, or %NULL
*
*
* Fills in @path and @focus_column with the current path and focus column. If
* the cursor isn't currently set, then *path will be %NULL. If no column
* currently has focus, then *focus_column will be %NULL.
......@@ -8829,7 +8829,7 @@ gtk_tree_view_get_search_equal_func (GtkTreeView *tree_view)
* @search_equal_func: the compare function to use during the search
* @search_user_data: user data to pass to @search_equal_func, or %NULL
* @search_destroy: Destroy notifier for @search_user_data, or %NULL
*
*
* Sets the compare function for the interactive search capabilities.
**/
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment