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

gEDA-cvs: branch: master updated (1.1.1.20070708-33-g30a86f3)



The branch, master has been updated
       via  30a86f3458c5a1562d97d33b06320647ed23132e (commit)
       via  f8f5c1f05c9c2dfa1d2566a113e9c295049f7564 (commit)
      from  ac47f97389af58e730dce5da19897cd0d3d152e3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/include/x_multiattrib.h |    2 ++
 gschem/src/o_undo.c            |    1 +
 gschem/src/x_multiattrib.c     |   15 +++++++++++++++
 3 files changed, 18 insertions(+), 0 deletions(-)


=================
 Commit Messages
=================

commit 30a86f3458c5a1562d97d33b06320647ed23132e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Jul 28 01:18:44 2007 +0100

    Change color in the multi-attrib dialog "value" entry when insensitive.
    
    Makes the "value" GtkTextView look the same as its neighbouring widgets
    when insensitive. Unfortunately GtkTextView always appears to render using
    the style's GTK_STATE_NORMAL text color. We save that initial value, and
    copy across either the saved value, or the GTK_STATE_INSENSITIVE text color
    when setting the widget sensitivities.
    
    NB: This is just a workaround for what appears to be a bug in GTK+.

:100644 100644 f3aee9c... 4190bcf... M	gschem/include/x_multiattrib.h
:100644 100644 6010291... ff5a8ff... M	gschem/src/x_multiattrib.c

commit f8f5c1f05c9c2dfa1d2566a113e9c295049f7564
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Jul 28 00:05:03 2007 +0100

    Update the multi-attrib dialog after an undo operation.
    
    The undo mechanism replaces the page (and selection object), so we need to
    poke the multi-attrib dialog after an undo operation for it to watch the
    new page's selection object.

:100644 100644 812eea2... 1fa60fa... M	gschem/src/o_undo.c

=========
 Changes
=========

commit 30a86f3458c5a1562d97d33b06320647ed23132e
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Jul 28 01:18:44 2007 +0100

    Change color in the multi-attrib dialog "value" entry when insensitive.
    
    Makes the "value" GtkTextView look the same as its neighbouring widgets
    when insensitive. Unfortunately GtkTextView always appears to render using
    the style's GTK_STATE_NORMAL text color. We save that initial value, and
    copy across either the saved value, or the GTK_STATE_INSENSITIVE text color
    when setting the widget sensitivities.
    
    NB: This is just a workaround for what appears to be a bug in GTK+.

diff --git a/gschem/include/x_multiattrib.h b/gschem/include/x_multiattrib.h
index f3aee9c..4190bcf 100644
--- a/gschem/include/x_multiattrib.h
+++ b/gschem/include/x_multiattrib.h
@@ -56,6 +56,8 @@ struct _Multiattrib {
   GtkWidget      *frame_attributes;
   GtkWidget      *frame_add;
 
+  GdkColor       value_normal_text_color;   /* Workaround for lameness in GtkTextView */
+
   gulong selection_changed_id;
 };
 
diff --git a/gschem/src/x_multiattrib.c b/gschem/src/x_multiattrib.c
index 6010291..ff5a8ff 100644
--- a/gschem/src/x_multiattrib.c
+++ b/gschem/src/x_multiattrib.c
@@ -1502,6 +1502,7 @@ static void multiattrib_init(Multiattrib *multiattrib)
   GtkCellRenderer *renderer;
   GtkTreeViewColumn *column;
   GtkTreeSelection *selection;
+  GtkStyle *style;
   
   /* dialog initialization */
   g_object_set (G_OBJECT (multiattrib),
@@ -1747,6 +1748,11 @@ static void multiattrib_init(Multiattrib *multiattrib)
                     "grab-focus",
                     G_CALLBACK (multiattrib_callback_value_grab_focus),
                     multiattrib);
+  /* Save the GTK_STATE_NORMAL color so we can work around GtkTextView's
+   * stubborn refusal to draw with GTK_STATE_INSENSITIVE later on */
+  style = gtk_widget_get_style (textview);
+  multiattrib->value_normal_text_color = style->text[ GTK_STATE_NORMAL ];
+
   gtk_container_add (GTK_CONTAINER (scrolled_win), textview);
   multiattrib->textview_value = GTK_TEXT_VIEW (textview);
   gtk_table_attach (GTK_TABLE (table), label,
@@ -1875,6 +1881,7 @@ void multiattrib_update (Multiattrib *multiattrib)
   OBJECT **object_attribs, *o_current;
   gint i;
   gboolean sensitive;
+  GtkStyle *style;
 
   g_assert (GSCHEM_DIALOG (multiattrib)->toplevel != NULL);
 
@@ -1887,6 +1894,14 @@ void multiattrib_update (Multiattrib *multiattrib)
   gtk_widget_set_sensitive (GTK_WIDGET (multiattrib->frame_attributes), sensitive);
   gtk_widget_set_sensitive (GTK_WIDGET (multiattrib->frame_add), sensitive);
 
+  /* Work around GtkTextView's stubborn indifference
+   * to GTK_STATE_INSENSITIVE when rendering its text. */
+  style = gtk_widget_get_style (GTK_WIDGET (multiattrib->textview_value));
+  gtk_widget_modify_text (GTK_WIDGET (multiattrib->textview_value),
+                          GTK_STATE_NORMAL,
+                          sensitive ? &multiattrib->value_normal_text_color
+                                    : &style->text[GTK_STATE_INSENSITIVE]);
+
   /* If we aren't sensitive, there is nothing more to do */
   if (!sensitive)
     return;

commit f8f5c1f05c9c2dfa1d2566a113e9c295049f7564
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Jul 28 00:05:03 2007 +0100

    Update the multi-attrib dialog after an undo operation.
    
    The undo mechanism replaces the page (and selection object), so we need to
    poke the multi-attrib dialog after an undo operation for it to watch the
    new page's selection object.

diff --git a/gschem/src/o_undo.c b/gschem/src/o_undo.c
index 812eea2..1fa60fa 100644
--- a/gschem/src/o_undo.c
+++ b/gschem/src/o_undo.c
@@ -420,6 +420,7 @@ void o_undo_callback(TOPLEVEL *w_current, int type)
 
   /* final redraw */
   x_pagesel_update (w_current);
+  x_multiattrib_update (w_current);
 
   /* Let the caller to decide if redraw or not */
   /* w_current->DONT_REDRAW = 0; */




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