Commit 0678e05a authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

*fixed regression where iemguis with custom foreground color tainted the border color

parent 294f3a29
...@@ -502,9 +502,8 @@ void iemgui_select(t_gobj *z, t_glist *glist, int selected) ...@@ -502,9 +502,8 @@ void iemgui_select(t_gobj *z, t_glist *glist, int selected)
x->x_selected = canvas; x->x_selected = canvas;
else else
x->x_selected = NULL; x->x_selected = NULL;
char fcol[8]; sprintf(fcol,"#%6.6x", x->x_fcol);
sys_vgui(".x%lx.c itemconfigure {x%lx&&border} -stroke %s\n", canvas, x, sys_vgui(".x%lx.c itemconfigure {x%lx&&border} -stroke %s\n", canvas, x,
x->x_selected && x->x_glist == canvas ? selection_color : fcol); x->x_selected && x->x_glist == canvas ? selection_color : border_color);
x->x_draw((void *)z, glist, IEM_GUI_DRAW_MODE_SELECT); x->x_draw((void *)z, glist, IEM_GUI_DRAW_MODE_SELECT);
if (selected < 2) if (selected < 2)
{ {
...@@ -1184,6 +1183,7 @@ void g_iemgui_setup (void) { ...@@ -1184,6 +1183,7 @@ void g_iemgui_setup (void) {
} }
const char *selection_color = "$pd_colors(selection)"; const char *selection_color = "$pd_colors(selection)";
const char *border_color = "$pd_colors(iemgui_border)";
#define GET_OUTLET t_outlet *out = x->x_obj.ob_outlet; /* can't use int o because there's not obj_nth_outlet function */ #define GET_OUTLET t_outlet *out = x->x_obj.ob_outlet; /* can't use int o because there's not obj_nth_outlet function */
#define SEND_BY_SYMBOL (iemgui_has_snd(x) && x->x_snd->s_thing && (!chk_putin || x->x_put_in2out)) #define SEND_BY_SYMBOL (iemgui_has_snd(x) && x->x_snd->s_thing && (!chk_putin || x->x_put_in2out))
......
...@@ -267,6 +267,7 @@ EXTERN void wb_init(t_widgetbehavior *wb, t_getrectfn gr, t_clickfn cl); // rena ...@@ -267,6 +267,7 @@ EXTERN void wb_init(t_widgetbehavior *wb, t_getrectfn gr, t_clickfn cl); // rena
extern t_symbol *s_empty; extern t_symbol *s_empty;
EXTERN const char *selection_color; EXTERN const char *selection_color;
EXTERN const char *border_color;
static inline int iemgui_has_snd (t_iemgui *x) {return x->x_snd!=s_empty;} static inline int iemgui_has_snd (t_iemgui *x) {return x->x_snd!=s_empty;}
static inline int iemgui_has_rcv (t_iemgui *x) {return x->x_rcv!=s_empty;} static inline int iemgui_has_rcv (t_iemgui *x) {return x->x_rcv!=s_empty;}
......
...@@ -44,9 +44,9 @@ void radio_draw_new(t_radio *x, t_glist *glist) ...@@ -44,9 +44,9 @@ void radio_draw_new(t_radio *x, t_glist *glist)
iemgui_base_draw_new(&x->x_gui); iemgui_base_draw_new(&x->x_gui);
for(i=0; i<n; i++) if (x->x_orient) { for(i=0; i<n; i++) if (x->x_orient) {
if (i) sys_vgui(".x%lx.c create pline %d %d %d %d " if (i) sys_vgui(".x%lx.c create prect %d %d %d %d "
"-stroke $pd_colors(iemgui_border) " "-stroke $pd_colors(iemgui_border) "
"-tags {%lxBASE%d %lxBASEL x%lx text iemgui border}\n", "-tags {%lxBASE%d %lxBASE x%lx text iemgui border}\n",
canvas, x1, yi, x1+d, yi, x, i, x, x); canvas, x1, yi, x1+d, yi, x, i, x, x);
sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x " sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x "
"-stroke #%6.6x -tags {%lxBUT%d x%lx text iemgui}\n", "-stroke #%6.6x -tags {%lxBUT%d x%lx text iemgui}\n",
...@@ -57,9 +57,9 @@ void radio_draw_new(t_radio *x, t_glist *glist) ...@@ -57,9 +57,9 @@ void radio_draw_new(t_radio *x, t_glist *glist)
yi += d; yi += d;
x->x_drawn = x->x_on; x->x_drawn = x->x_on;
} else { } else {
if (i) sys_vgui(".x%lx.c create pline %d %d %d %d " if (i) sys_vgui(".x%lx.c create prect %d %d %d %d "
"-stroke $pd_colors(iemgui_border) " "-stroke $pd_colors(iemgui_border) "
"-tags {%lxBASE%d %lxBASEL x%lx text iemgui border}\n", "-tags {%lxBASE%d %lxBASE x%lx text iemgui border}\n",
canvas, xi, y1, xi, y1+d, x, i, x, x); canvas, xi, y1, xi, y1+d, x, i, x, x);
sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x " sys_vgui(".x%lx.c create prect %d %d %d %d -fill #%6.6x "
"-stroke #%6.6x -tags {%lxBUT%d x%lx text iemgui}\n", "-stroke #%6.6x -tags {%lxBUT%d x%lx text iemgui}\n",
......
Supports Markdown
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