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

Re: gEDA-user: gschem usability: expand the component tree after filtering



Hello,

I very like the feature Krzysztof introduced with his patch and would like to have this feature in PCB, too. The appended patch does exactly the same for pcb. The only modification is, that the struct 'compselect' is called 'library_window' in pcb.

I have also done a feature request for this patch at https://bugs.launchpad.net/pcb/+bug/753643.

Hope, some of you like this feature, too and hope to get it accepted.

Best regards,
Felix


Am 03.01.2011 00:52, schrieb Krzysztof KoÅciuszkiewicz:
All,

I found it annoying that I need to "click through" the whole component
tree after filtering the symbol file names.  For some time I've been
running my copy with the change that expands the tree after the
filtering by name is done. This saves 1+ clicks in the most common
use-case: add a known symbol to the diagram.

The patch is here:
https://sourceforge.net/tracker/?func=detail&aid=3149995&group_id=161080&atid=818428

Best regards,
From 9c552a71aaf457d648ad824af4101afffc960509 Mon Sep 17 00:00:00 2001
From: Felix Ruoff <Felix@xxxxxxxxxxxxxxxxxx>
Date: Thu, 7 Apr 2011 16:38:51 +0200
Subject: [PATCH] expand library tree after filtering

This patch changes the behavior of the library selection dialog.
After filtering by name is applied the tree view of matching components
is automatically expanded so that all leafs are immediately selectable.
The tree view is collapsed when the filter is cleared.

Patch is adapted from Krzysztof Kosciuszkiewicz's patch for gschem.

Closes-bug: lp-753643
---
 src/hid/gtk/gui-library-window.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/hid/gtk/gui-library-window.c b/src/hid/gtk/gui-library-window.c
index b101576..8c8ae17 100644
--- a/src/hid/gtk/gui-library-window.c
+++ b/src/hid/gtk/gui-library-window.c
@@ -432,7 +432,16 @@ library_window_filter_timeout (gpointer data)
 
   if (model != NULL)
     {
+      const gchar *text = gtk_entry_get_text (library_window->entry_filter);
       gtk_tree_model_filter_refilter ((GtkTreeModelFilter *) model);
+      if (strcmp (text, "") != 0)
+        {
+          /* filter text not-empty */
+          gtk_tree_view_expand_all (library_window->libtreeview);
+        } else {
+          /* filter text is empty, collapse expanded tree */
+          gtk_tree_view_collapse_all (library_window->libtreeview);
+        }
     }
 
   /* return FALSE to remove the source */
-- 
1.7.1


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user