ui/common/wrapper.c

changeset 746
7899792496cb
parent 736
3ad4792ffadc
child 782
a72d7509d292
equal deleted inserted replaced
745:a4ee36ff7147 746:7899792496cb
260 if(index >= 0 && index < flist->nfiles) { 260 if(index >= 0 && index < flist->nfiles) {
261 return flist->files[index]; 261 return flist->files[index];
262 } 262 }
263 return NULL; 263 return NULL;
264 } 264 }
265
266 /* ---------------------------- UiTextStyle ---------------------------- */
267
268 void ui_textstyle_set_bold(UiTextStyle *style, UiBool set) {
269 if(set) {
270 style->text_style |= UI_TEXT_STYLE_BOLD;
271 } else {
272 style->text_style &= ~UI_TEXT_STYLE_BOLD;
273 }
274 }
275
276 void ui_textstyle_set_underline(UiTextStyle *style, UiBool set) {
277 if(set) {
278 style->text_style |= UI_TEXT_STYLE_UNDERLINE;
279 } else {
280 style->text_style &= ~UI_TEXT_STYLE_UNDERLINE;
281 }
282 }
283
284 void ui_textstyle_set_italic(UiTextStyle *style, UiBool set) {
285 if(set) {
286 style->text_style |= UI_TEXT_STYLE_ITALIC;
287 } else {
288 style->text_style &= ~UI_TEXT_STYLE_ITALIC;
289 }
290 }
291
292 void ui_textstyle_set_color(UiTextStyle *style, int r, int g, int b) {
293 style->fg_set = TRUE;
294 style->fg.red = r;
295 style->fg.green = g;
296 style->fg.blue = b;
297 }
298
299 void ui_textstyle_enable_color(UiTextStyle *style, UiBool enable) {
300 style->fg_set = enable;
301 }

mercurial