@@ -162,7 +162,9 @@ static void comment_draw_outline(t_comment *x){
162
162
(unsigned long )x , // %lx_outline
163
163
(unsigned long )x , // all%lx
164
164
x -> x_zoom ,
165
- x -> x_select ? "blue" : "black" );
165
+ x -> x_select ?
166
+ THISGUI -> i_selectcolor -> s_name :
167
+ THISGUI -> i_foregroundcolor -> s_name );
166
168
}
167
169
}
168
170
@@ -175,7 +177,7 @@ static void comment_draw_handle(t_comment *x){
175
177
if (x -> x_resized )
176
178
x2 = x1 + x -> x_max_pixwidth * x -> x_zoom ;
177
179
sys_vgui ("canvas %s -width %d -height %d -bg %s -cursor sb_h_double_arrow\n" ,
178
- ch -> h_pathname , COMMENT_HANDLE_WIDTH , x -> x_height , "black" );
180
+ ch -> h_pathname , COMMENT_HANDLE_WIDTH , x -> x_height , THISGUI -> i_selectcolor -> s_name );
179
181
sys_vgui ("bind %s <Button> {pdsend [concat %s _click 1 \\;]}\n" , ch -> h_pathname , ch -> h_bindsym -> s_name );
180
182
sys_vgui ("bind %s <ButtonRelease> {pdsend [concat %s _click 0 \\;]}\n" , ch -> h_pathname , ch -> h_bindsym -> s_name );
181
183
sys_vgui ("bind %s <Motion> {pdsend [concat %s _motion %%x %%y \\;]}\n" , ch -> h_pathname , ch -> h_bindsym -> s_name );
@@ -196,9 +198,11 @@ static void comment_draw_inlet(t_comment *x){
196
198
if (x -> x_edit && x -> x_receive == & s_ ){
197
199
t_canvas * cv = glist_getcanvas (x -> x_glist );
198
200
int xpos = text_xpix (& x -> x_obj , x -> x_glist ), ypos = text_ypix (& x -> x_obj , x -> x_glist );
199
- sys_vgui (".x%lx.c create rectangle %d %d %d %d -fill black -tags [list %lx_in all%lx]\n" ,
200
- cv , xpos , ypos , xpos + (IOWIDTH * x -> x_zoom ), ypos + (IHEIGHT * x -> x_zoom )- x -> x_zoom ,
201
- (unsigned long )x , (unsigned long )x );
201
+ sys_vgui (".x%lx.c create rectangle %d %d %d %d -fill %s -tags [list %lx_in all%lx]\n" ,
202
+ cv , xpos , ypos , xpos + (IOWIDTH * x -> x_zoom ),
203
+ ypos + (IHEIGHT * x -> x_zoom )- x -> x_zoom ,
204
+ THISGUI -> i_foregroundcolor -> s_name ,
205
+ (unsigned long )x , (unsigned long )x );
202
206
}
203
207
}
204
208
}
@@ -234,7 +238,7 @@ static void comment_draw(t_comment *x){
234
238
y2 + 2 * x -> x_zoom ,
235
239
(unsigned long )x ,
236
240
(unsigned long )x ,
237
- x -> x_outline ? "black" : x -> x_bgcolor ,
241
+ x -> x_outline ? THISGUI -> i_foregroundcolor -> s_name : x -> x_bgcolor ,
238
242
x -> x_bgcolor );
239
243
}
240
244
char buf [COMMENT_OUTBUFSIZE ], * outbuf , * outp ;
@@ -249,7 +253,7 @@ static void comment_draw(t_comment *x){
249
253
text_ypix ((t_text * )x , x -> x_glist ) + x -> x_zoom , // %d
250
254
x -> x_fontname -> s_name , // {%s}
251
255
x -> x_fontsize * x -> x_zoom , // -%d
252
- x -> x_select ? "blue" : x -> x_color , // %s
256
+ x -> x_select ? THISGUI -> i_selectcolor -> s_name : x -> x_color , // %s
253
257
x -> x_bufsize , // %.
254
258
x -> x_buf , // *s
255
259
x -> x_max_pixwidth * x -> x_zoom , // %d
@@ -393,9 +397,10 @@ static void comment_select(t_gobj *z, t_glist *glist, int state){
393
397
x -> x_select = state ;
394
398
if (!state && x -> x_active )
395
399
comment_activate (z , glist , 0 );
396
- sys_vgui (".x%lx.c itemconfigure txt%lx -fill %s\n" , x -> x_cv , (unsigned long )x , state ? "blue" : x -> x_color );
400
+ sys_vgui (".x%lx.c itemconfigure txt%lx -fill %s\n" , x -> x_cv , (unsigned long )x , state ? THISGUI -> i_selectcolor -> s_name : x -> x_color );
397
401
sys_vgui (".x%lx.c itemconfigure %lx_outline -width %d -outline %s\n" ,
398
- x -> x_cv , (unsigned long )x , x -> x_zoom , state ? "blue" : "black" );
402
+ x -> x_cv , (unsigned long )x , x -> x_zoom ,
403
+ state ? THISGUI -> i_selectcolor -> s_name : THISGUI -> i_foregroundcolor -> s_name );
399
404
// A regular rtext should set 'canvas_editing' variable to its canvas, we don't do it coz
400
405
// we get keys via global binding to "#key" (and coz 'canvas_editing' isn't exported).
401
406
}
@@ -471,8 +476,6 @@ static void comment__click_callback(t_comment *x, t_symbol *s, int ac, t_atom *a
471
476
}
472
477
}
473
478
else if (xx > x -> x_x2 - COMMENT_HANDLE_WIDTH ){ // start resizing
474
- sprintf (outp , ".x%lx.c bind txt%lx <ButtonRelease> {pdsend {%s _release %s}}\n" ,
475
- cv , (unsigned long )x , x -> x_bindsym -> s_name , x -> x_bindsym -> s_name );
476
479
outp += strlen (outp );
477
480
sprintf (outp , ".x%lx.c bind txt%lx <Motion> {pdsend {%s _motion %s %%x %%y}}\n" ,
478
481
cv , (unsigned long )x , x -> x_bindsym -> s_name , x -> x_bindsym -> s_name );
@@ -906,7 +909,7 @@ static void comment_bgcolor(t_comment *x, t_float r, t_float g, t_float b){
906
909
sys_vgui (".x%lx.c itemconfigure bg%lx -outline %s -fill %s\n" ,
907
910
x -> x_cv ,
908
911
(unsigned long )x ,
909
- x -> x_outline ? "black" : x -> x_bgcolor ,
912
+ x -> x_outline ? THISGUI -> i_foregroundcolor -> s_name : x -> x_bgcolor ,
910
913
x -> x_bgcolor );
911
914
}
912
915
}
@@ -990,7 +993,7 @@ static void comment_outline(t_comment *x, t_floatarg outline){
990
993
if (x -> x_outline || x -> x_edit ){
991
994
comment_draw_outline (x );
992
995
if (x -> x_bg_flag )
993
- sys_vgui (".x%lx.c itemconfigure bg%lx -outline black \n" , x -> x_cv , (unsigned long )x );
996
+ sys_vgui (".x%lx.c itemconfigure bg%lx -outline %s \n" , x -> x_cv , (unsigned long )x , THISGUI -> i_foregroundcolor -> s_name );
994
997
}
995
998
else {
996
999
sys_vgui (".x%lx.c delete %lx_outline\n" , (unsigned long )x -> x_cv , (unsigned long )x );
0 commit comments