gimp r26875 - in trunk: . app/widgets



Author: mitch
Date: Fri Sep  5 14:06:01 2008
New Revision: 26875
URL: http://svn.gnome.org/viewvc/gimp?rev=26875&view=rev

Log:
2008-09-05  Michael Natterer  <mitch gimp org>

	Bug 545325 â Scrollbars do not disappear automatically

	* app/widgets/gimpcontainertreeview.c: autosize the columns after
	each operation that can reduce the treeview's width.



Modified:
   trunk/ChangeLog
   trunk/app/widgets/gimpcontainertreeview.c

Modified: trunk/app/widgets/gimpcontainertreeview.c
==============================================================================
--- trunk/app/widgets/gimpcontainertreeview.c	(original)
+++ trunk/app/widgets/gimpcontainertreeview.c	Fri Sep  5 14:06:01 2008
@@ -513,6 +513,8 @@
     }
 
   parent_view_iface->set_container (view, container);
+
+  gtk_tree_view_columns_autosize (tree_view->view);
 }
 
 static void
@@ -574,6 +576,8 @@
     {
       gtk_list_store_remove (GTK_LIST_STORE (tree_view->model), iter);
 
+      gtk_tree_view_columns_autosize (tree_view->view);
+
       /*  If the store is empty after this remove, clear out renderers
        *  from all cells so they don't keep refing the viewables
        *  (see bug #149906).
@@ -673,12 +677,21 @@
   if (iter)
     {
       gchar *name = gimp_viewable_get_description (viewable, NULL);
+      gchar *old_name;
+
+      gtk_tree_model_get (tree_view->model, iter,
+                          COLUMN_NAME, &old_name,
+                          -1);
 
       gtk_list_store_set (GTK_LIST_STORE (tree_view->model), iter,
                           COLUMN_NAME, name,
                           -1);
 
+      if (name && old_name && strlen (name) < strlen (old_name))
+        gtk_tree_view_columns_autosize (tree_view->view);
+
       g_free (name);
+      g_free (old_name);
     }
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]