Changeset b433f68 in mainline for uspace/lib/ui/src/checkbox.c


Ignore:
Timestamp:
2021-02-26T16:23:36Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
77ffa01
Parents:
fe40b67
Message:

Puttext needs to know the color of the text being printed

So far we were using the GC's current drawing color. But unless there
was a way to read it, we could not render text-mode text in the correct
color.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/checkbox.c

    rfe40b67 rb433f68  
    192192
    193193                gfx_text_fmt_init(&fmt);
     194                fmt.color = checkbox->res->entry_fg_color;
    194195                fmt.halign = gfx_halign_center;
    195196                fmt.valign = gfx_valign_center;
    196 
    197                 rc = gfx_set_color(checkbox->res->gc,
    198                     checkbox->res->entry_fg_color);
    199                 if (rc != EOK)
    200                         goto error;
    201197
    202198                rc = gfx_puttext(checkbox->res->font, &box_center, &fmt, "X");
     
    207203        /* Paint checkbox label */
    208204
    209         rc = gfx_set_color(checkbox->res->gc, checkbox->res->wnd_text_color);
    210         if (rc != EOK)
    211                 goto error;
    212 
    213         /* Label position */
    214205        pos.x = box_rect.p1.x + checkbox_label_margin;
    215206        pos.y = (box_rect.p0.y + box_rect.p1.y) / 2;
    216207
    217208        gfx_text_fmt_init(&fmt);
     209        fmt.color = checkbox->res->wnd_text_color;
    218210        fmt.halign = gfx_halign_left;
    219211        fmt.valign = gfx_valign_center;
Note: See TracChangeset for help on using the changeset viewer.