r5763 - trunk/eda/fped

werner at docs.openmoko.org werner at docs.openmoko.org
Thu Dec 31 10:34:18 CET 2009


Author: werner
Date: 2009-12-31 10:34:17 +0100 (Thu, 31 Dec 2009)
New Revision: 5763

Modified:
   trunk/eda/fped/gui_frame.c
   trunk/eda/fped/gui_style.h
   trunk/eda/fped/obj.h
Log:
When selecting an expression of an assignment and then selecting another 
expression, the background of the first expression did not revert to its 
original color.

- gui_style.h (COLOR_CHOICE_SELECTED): made blue a bit lighter, to improve
  contrast of black foreground text
- gui_frame.c (unselect_value): build_assignment uses COLOR_EXPR_PASSIVE for
  expressions in assignments, so we also have to do the same here.



Modified: trunk/eda/fped/gui_frame.c
===================================================================
--- trunk/eda/fped/gui_frame.c	2009-12-27 22:07:16 UTC (rev 5762)
+++ trunk/eda/fped/gui_frame.c	2009-12-31 09:34:17 UTC (rev 5763)
@@ -508,8 +508,19 @@
 {
 	struct value *value = data;
 
+	/*
+	 * This condition is a little cryptic. Here is what it does:
+	 *
+	 * IF table/assignment (not loop)
+	 * AND the current row is the active (selected) row
+	 * AND it's an assignment (not a table).
+	 *
+	 * We need the last condition because the expressions of assignments
+	 * are drawn with COLOR_VAR_PASSIVE. (See build_assignment.)
+	 */
 	label_in_box_bg(value->widget,
-	    value->row && value->row->table->active_row == value->row ?
+	    value->row && value->row->table->active_row == value->row &&
+	    value->row->table->rows->next ?
 	     COLOR_CHOICE_SELECTED : COLOR_EXPR_PASSIVE);
 }
 
@@ -620,6 +631,12 @@
 }
 
 
+/*
+ * In tables, expressions in the active row have a COLOR_CHOICE_SELECTED
+ * background. While expressions in assignments are technically on the active
+ * (and only) row, we use COLOR_VAR_PASSIVE for better readability.
+ */
+
 static void build_assignment(GtkWidget *vbox, struct frame *frame,
     struct table *table)
 {

Modified: trunk/eda/fped/gui_style.h
===================================================================
--- trunk/eda/fped/gui_style.h	2009-12-27 22:07:16 UTC (rev 5762)
+++ trunk/eda/fped/gui_style.h	2009-12-31 09:34:17 UTC (rev 5763)
@@ -83,7 +83,7 @@
 #define	COLOR_EXPR_PASSIVE	"#f0f0ff"
 #define	COLOR_EXPR_EDITING	COLOR_EDITING
 #define	COLOR_CHOICE_UNSELECTED	COLOR_EXPR_PASSIVE
-#define	COLOR_CHOICE_SELECTED	"#9090ff"
+#define	COLOR_CHOICE_SELECTED	"#a0a0ff"
 #define	COLOR_ROW_UNSELECTED	COLOR_CHOICE_UNSELECTED
 #define	COLOR_ROW_SELECTED	COLOR_CHOICE_SELECTED
 

Modified: trunk/eda/fped/obj.h
===================================================================
--- trunk/eda/fped/obj.h	2009-12-27 22:07:16 UTC (rev 5762)
+++ trunk/eda/fped/obj.h	2009-12-31 09:34:17 UTC (rev 5763)
@@ -42,7 +42,7 @@
 	struct expr *expr;
 	struct value *next;
 
-	/* back reference */
+	/* back reference, NULL if loop */
 	struct row *row;
 
 	/* for the GUI */




More information about the commitlog mailing list