Commit a2ad0b55 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

allow gatom to have an "activated" text color

parent 1d9b01aa
......@@ -264,6 +264,11 @@ text {
fill: blue;
}
/* gatom "activated" text (i.e., when it has the keyboard focus) */
.atom.activated text {
fill: red;
}
/* test of xlet hover animation... this should
probably use the web animation API instead. That
way the animation won't get cut off when you
......
......@@ -3193,6 +3193,16 @@ function gui_gatom_dialog(did, attr_array) {
attr_array_to_object(attr_array));
}
function gui_gatom_activate(cid, tag, state) {
var g = get_gobj(cid, tag);
if (state !== 0) {
g.classList.add("activated");
} else {
g.classList.remove("activated");
}
post("activating gatom: cid is " + cid + " and tag is " + tag + " and t is " + t);
}
function gui_iemgui_dialog(did, attr_array) {
//for (var i = 0; i < attr_array.length; i++) {
// attr_array[i] = '"' + attr_array[i] + '"';
......
......@@ -878,6 +878,10 @@ static void gatom_retext(t_gatom *x, int senditup, int recolor)
{
//sys_vgui(".x%lx.c itemconfigure %s -fill %s\n", canvas,
// rtext_gettag(y), "$pd_colors(text)");
gui_vmess("gui_gatom_activate", "xsi",
canvas,
rtext_gettag(y),
0);
}
binbuf_clear(x->a_text.te_binbuf);
binbuf_add(x->a_text.te_binbuf, 1, &x->a_atom);
......@@ -1818,6 +1822,10 @@ static int text_click(t_gobj *z, struct _glist *glist,
/* Change the gatom blue when it's clicked? Need to test... */
sys_vgui(".x%lx.c itemconfigure %s -fill %s\n", canvas,
rtext_gettag(y), "$pd_colors(selection)");
gui_vmess("gui_gatom_activate", "xsi",
canvas,
rtext_gettag(y),
1);
gatom_click((t_gatom *)x, (t_floatarg)xpix, (t_floatarg)ypix,
(t_floatarg)shift, (t_floatarg)0, (t_floatarg)alt);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment