Changeset b433f68 in mainline for uspace/lib/ui/src/wdecor.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/wdecor.c

    rfe40b67 rb433f68  
    213213
    214214                gfx_text_fmt_init(&fmt);
     215                fmt.color = wdecor->active ?
     216                    wdecor->res->tbar_act_text_color :
     217                    wdecor->res->tbar_inact_text_color;
    215218                fmt.halign = gfx_halign_center;
    216219                fmt.valign = gfx_valign_center;
     
    218221                pos.x = (trect.p0.x + trect.p1.x) / 2;
    219222                pos.y = (trect.p0.y + trect.p1.y) / 2;
    220 
    221                 rc = gfx_set_color(wdecor->res->gc, wdecor->active ?
    222                     wdecor->res->tbar_act_text_color :
    223                     wdecor->res->tbar_inact_text_color);
    224                 if (rc != EOK)
    225                         return rc;
    226223
    227224                rc = gfx_puttext(wdecor->res->font, &pos, &fmt, wdecor->caption);
Note: See TracChangeset for help on using the changeset viewer.