[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (c0ec7462facd046414734ebd0a65917f67ddcf74)
The branch, master has been updated
via c0ec7462facd046414734ebd0a65917f67ddcf74 (commit)
from ab1c8c4d4ec61d85083d61668042526a878fcddc (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
=========
src/hid/gtk/gui-top-window.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
=================
Commit Messages
=================
commit c0ec7462facd046414734ebd0a65917f67ddcf74
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Fix prelight state for layer button to show current status
One of the ways we identify whether a layer is switched on or off is
by changing the background colour of the GtkToggleButton representing
that layer.
Fix the prelight (mouse-over) background style to match the current
button state, so as to give immediate feed-back when the user presses
the button, and make the interface less confusing.
Closes-bug: lp-699150
:100644 100644 b4c8c42... f2cdb99... M src/hid/gtk/gui-top-window.c
=========
Changes
=========
commit c0ec7462facd046414734ebd0a65917f67ddcf74
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
hid/gtk: Fix prelight state for layer button to show current status
One of the ways we identify whether a layer is switched on or off is
by changing the background colour of the GtkToggleButton representing
that layer.
Fix the prelight (mouse-over) background style to match the current
button state, so as to give immediate feed-back when the user presses
the button, and make the interface less confusing.
Closes-bug: lp-699150
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index b4c8c42..f2cdb99 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -1465,17 +1465,19 @@ layer_enable_button_cb (GtkWidget * widget, gpointer data)
}
static void
-layer_button_set_color (LayerButtonSet * lb, gchar * color_string)
+layer_button_set_color (LayerButtonSet * lb, gchar * color_string,
+ bool set_prelight)
{
GdkColor color;
if (!lb->layer_enable_ebox)
return;
-
+
color.red = color.green = color.blue = 0;
ghid_map_color_string (color_string, &color);
gtk_widget_modify_bg (lb->layer_enable_ebox, GTK_STATE_ACTIVE, &color);
- gtk_widget_modify_bg (lb->layer_enable_ebox, GTK_STATE_PRELIGHT, &color);
+ gtk_widget_modify_bg (lb->layer_enable_ebox, GTK_STATE_PRELIGHT,
+ set_prelight ? &color : NULL);
gtk_widget_modify_fg (lb->label, GTK_STATE_ACTIVE, &WhitePixel);
}
@@ -1573,7 +1575,7 @@ make_layer_buttons (GtkWidget * vbox, GHidPort * port)
lb->text = g_strdup (text);
lb->label = label;
- layer_button_set_color (lb, color_string);
+ layer_button_set_color (lb, color_string, active);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), active);
g_signal_connect (G_OBJECT (button), "toggled",
@@ -1605,11 +1607,13 @@ ghid_layer_buttons_color_update (void)
for (i = 0; i < N_LAYER_BUTTONS; ++i)
{
+ bool active;
+
lb = &layer_buttons[i];
layer_process (&color_string, NULL, NULL, i);
-
- layer_button_set_color (lb, color_string);
+ active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lb));
+ layer_button_set_color (lb, color_string, active);
}
}
@@ -1621,6 +1625,7 @@ ghid_layer_enable_buttons_update (void)
{
LayerButtonSet *lb;
gchar *s;
+ gchar *color_string;
gint i;
#ifdef DEBUG_MENUS
@@ -1651,6 +1656,8 @@ ghid_layer_enable_buttons_update (void)
printf ("ghid_layer_enable_buttons_update: active=%d new=%d\n",
active, new);
}
+ layer_process (&color_string, NULL, NULL, i);
+ layer_button_set_color (lb, color_string, PCB->Data->Layer[i].On);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(lb->layer_enable_button),
PCB->Data->Layer[i].On);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs