On Thu, 2008-10-09 at 11:07 +0100, Peter Clifton wrote:
> > Peter, can you review the whole feature? I think it's complete now.
> 
> I'll pull your code, rebase on top of the cario + local_mods I'm running
> as "production code", so I'll end up using the code over the next day or
> so. It looks good to the eye.

Comments from having tried the code:

Need to add settings-save code to make the vpaned widget store its
position. I've attached a suggested* patch.)

(* Although I'm now wondering if naming the settings "hpaned" and
"vpaned" is in retrospect a good idea - in case anyone wants to change
the layout of this dialog in the future, using more of these widgets. I
could have named them more explicitly as to what they separate etc.)

I wondered brieflyy about using an expander button to show/hide the
attributes section of the dialog, but I'm not sure how busy that will
feel with an VPaned as well. (I'd not like to loose the ability to
resize that portion of the dialog).

I'm also tempted to see what it looks like with the attribute preview
list tucked under the graphic preview, with the component list retaining
the full height of the screen.

Best wishes,

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
>From ad81f5f0a62693c4ea2b587f50ad7aca0acb62b8 Mon Sep 17 00:00:00 2001
From: Peter Clifton <[EMAIL PROTECTED]>
Date: Thu, 9 Oct 2008 11:22:00 +0100
Subject: [PATCH] gschem: Make component selector remember position of its vpaned

---
 gschem/include/x_compselect.h |    2 +-
 gschem/src/x_compselect.c     |    8 ++++++++
 2 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/gschem/include/x_compselect.h b/gschem/include/x_compselect.h
index 0ef5c22..e99c049 100644
--- a/gschem/include/x_compselect.h
+++ b/gschem/include/x_compselect.h
@@ -61,7 +61,7 @@ struct _CompselectClass {
 struct _Compselect {
   GschemDialog parent_instance;
 
-  GtkWidget   *hpaned;
+  GtkWidget   *hpaned, *vpaned;
   GtkTreeView *libtreeview, *inusetreeview, *attrtreeview;
   GtkNotebook *viewtabs;
   Preview     *preview;
diff --git a/gschem/src/x_compselect.c b/gschem/src/x_compselect.c
index 3dd7ba4..f279269 100644
--- a/gschem/src/x_compselect.c
+++ b/gschem/src/x_compselect.c
@@ -1225,6 +1225,9 @@ compselect_geometry_save (GschemDialog *dialog, GKeyFile *key_file, gchar *group
   position = gtk_paned_get_position (GTK_PANED (COMPSELECT (dialog)->hpaned));
   g_key_file_set_integer (key_file, group_name, "hpaned", position );
 
+  position = gtk_paned_get_position (GTK_PANED (COMPSELECT (dialog)->vpaned));
+  g_key_file_set_integer (key_file, group_name, "vpaned", position );
+
   position = gtk_notebook_get_current_page (COMPSELECT (dialog)->viewtabs);
   g_key_file_set_integer (key_file, group_name, "source-tab", position );
 }
@@ -1253,6 +1256,10 @@ compselect_geometry_restore (GschemDialog *dialog, GKeyFile *key_file, gchar *gr
   if (position != 0)
     gtk_paned_set_position (GTK_PANED (COMPSELECT (dialog)->hpaned), position);
 
+  position = g_key_file_get_integer (key_file, group_name, "vpaned", NULL);
+  if (position != 0)
+    gtk_paned_set_position (GTK_PANED (COMPSELECT (dialog)->vpaned), position);
+
   position = g_key_file_get_integer (key_file, group_name, "source-tab", NULL);
   gtk_notebook_set_current_page (COMPSELECT (dialog)->viewtabs, position);
 }
@@ -1337,6 +1344,7 @@ compselect_constructor (GType type,
                                     /* GtkContainer */
                                     "border-width", 5,
                                      NULL));
+  compselect->vpaned = vpaned;
 
   /* horizontal pane containing selection and preview */
   hpaned = GTK_WIDGET (g_object_new (GTK_TYPE_HPANED,
-- 
1.5.6.3


_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to