Changeset 4583015 in mainline for uspace/lib/ui/src/pbutton.c


Ignore:
Timestamp:
2022-03-07T16:10:44Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ca2680d
Parents:
5c27e77
Message:

Add font to gfx_text_fmt_t

This is quite logical and saves us one argument that we need to pass to
all text formatting functions.

File:
1 edited

Legend:

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

    r5c27e77 r4583015  
    307307
    308308        gfx_text_fmt_init(&fmt);
     309        fmt.font = pbutton->res->font;
    309310        fmt.color = pbutton->res->btn_text_color;
    310311        fmt.halign = gfx_halign_center;
    311312        fmt.valign = gfx_valign_center;
    312313
    313         rc = gfx_puttext(pbutton->res->font, &pos, &fmt, pbutton->caption);
     314        rc = gfx_puttext(&pos, &fmt, pbutton->caption);
    314315        if (rc != EOK)
    315316                goto error;
     
    379380
    380381        gfx_text_fmt_init(&fmt);
     382        fmt.font = pbutton->res->font;
    381383        fmt.color = pbutton->res->btn_text_color;
    382384        fmt.halign = gfx_halign_center;
    383385        fmt.valign = gfx_valign_center;
    384386
    385         rc = gfx_puttext(pbutton->res->font, &pos, &fmt, pbutton->caption);
     387        rc = gfx_puttext(&pos, &fmt, pbutton->caption);
    386388        if (rc != EOK)
    387389                goto error;
Note: See TracChangeset for help on using the changeset viewer.