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


Ignore:
Timestamp:
2022-03-07T16:10:44Z (2 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/rbutton.c

    r5c27e77 r4583015  
    278278
    279279        gfx_text_fmt_init(&fmt);
     280        fmt.font = rbutton->group->res->font;
    280281        fmt.color = rbutton->group->res->wnd_text_color;
    281282        fmt.halign = gfx_halign_left;
    282283        fmt.valign = gfx_valign_center;
    283284
    284         rc = gfx_puttext(rbutton->group->res->font, &pos, &fmt,
    285             rbutton->caption);
     285        rc = gfx_puttext(&pos, &fmt, rbutton->caption);
    286286        if (rc != EOK)
    287287                goto error;
     
    316316
    317317        gfx_text_fmt_init(&fmt);
     318        fmt.font = rbutton->group->res->font;
    318319        fmt.color = depressed ? rbutton->group->res->entry_act_bg_color :
    319320            rbutton->group->res->wnd_text_color;
     
    321322        fmt.valign = gfx_valign_top;
    322323
    323         rc = gfx_puttext(rbutton->group->res->font, &pos, &fmt,
    324             rbutton->group->selected == rbutton ? "(\u2022)" : "( )");
     324        rc = gfx_puttext(&pos, &fmt, rbutton->group->selected == rbutton ?
     325            "(\u2022)" : "( )");
    325326        if (rc != EOK)
    326327                goto error;
     
    332333        fmt.color = rbutton->group->res->wnd_text_color;
    333334
    334         rc = gfx_puttext(rbutton->group->res->font, &pos, &fmt,
    335             rbutton->caption);
     335        rc = gfx_puttext(&pos, &fmt, rbutton->caption);
    336336        if (rc != EOK)
    337337                goto error;
Note: See TracChangeset for help on using the changeset viewer.