]> Pileus Git - ~andy/gtk/commitdiff
change scroll_to_cell delayed code to happen in size_allocate.
authorJonathan Blandford <jrb@redhat.com>
Mon, 1 Oct 2001 18:12:34 +0000 (18:12 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Mon, 1 Oct 2001 18:12:34 +0000 (18:12 +0000)
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.

14 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
docs/reference/gtk/tmpl/gtktreeview.sgml
gtk/gtkrbtree.c
gtk/gtkstyle.c
gtk/gtktreedatalist.c
gtk/gtktreemodel.c
gtk/gtktreestore.c
gtk/gtktreeview.c

index f3e2c00e0f7b39713751271854066c811c95f623..7a0bef6945155312322eb30f6c5bb77c69b41fcc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+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
index f3e2c00e0f7b39713751271854066c811c95f623..7a0bef6945155312322eb30f6c5bb77c69b41fcc 100644 (file)
@@ -1,3 +1,15 @@
+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
index f3e2c00e0f7b39713751271854066c811c95f623..7a0bef6945155312322eb30f6c5bb77c69b41fcc 100644 (file)
@@ -1,3 +1,15 @@
+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
index f3e2c00e0f7b39713751271854066c811c95f623..7a0bef6945155312322eb30f6c5bb77c69b41fcc 100644 (file)
@@ -1,3 +1,15 @@
+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
index f3e2c00e0f7b39713751271854066c811c95f623..7a0bef6945155312322eb30f6c5bb77c69b41fcc 100644 (file)
@@ -1,3 +1,15 @@
+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
index f3e2c00e0f7b39713751271854066c811c95f623..7a0bef6945155312322eb30f6c5bb77c69b41fcc 100644 (file)
@@ -1,3 +1,15 @@
+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
index f3e2c00e0f7b39713751271854066c811c95f623..7a0bef6945155312322eb30f6c5bb77c69b41fcc 100644 (file)
@@ -1,3 +1,15 @@
+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
index c086902478bc3a96d3b01e7fc33f3e2d0c58bf3d..39c0aa775b164ee75d35b97519c7a678f894c299 100644 (file)
@@ -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>
index 348b120bed67c181174822ea329f3ce27c4d0384..86690ea91888091bcd6f23e4eb34bd4b5ff024b3 100644 (file)
@@ -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)
index 3a4cdb8f85418202158a57aed8f07d6f8cfe2dd1..b9c5afc3aa9756fe70da82c31db438bd8d610747 100644 (file)
@@ -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)
     {
index 5a429ad98b4536dac843cdbd5be671921ca06d40..81d6332e6f3c029d367f69772b18d8ae03920334 100644 (file)
@@ -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:
index ffde83b8eb5643f000c57f9273fbdafc85fc9410..ecc23857f3f4fa5257bfdab35fe63ece2796ae42 100644 (file)
@@ -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);
     }
index 5418a035555b64065b8f769bf67ac0013b9a3c46..764b9d1e87659d9635b12229cfcbd6832125828d 100644 (file)
@@ -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
index 6aa5ec47be8d6c8d0615bb44195905fd1a04254d..bd3e561aac5df67f1bc2e45baa1d4322ef829578 100644 (file)
@@ -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