Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a0aeb8f in mainline for uspace/lib/ui/src/label.c


Ignore:
Timestamp:
2021-09-05T08:11:37Z (7 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
8ce56a6
Parents:
ab3bfc1
git-author:
Jiri Svoboda <jiri@…> (2021-09-05 08:09:56)
git-committer:
Jiri Svoboda <jiri@…> (2021-09-05 08:11:37)
Message:

Fix broken T-shirt slogan

Need to make sure "# hello -d cons@" works well

File:
1 edited

Legend:

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

    rab3bfc1 ra0aeb8f  
    136136}
    137137
     138/** Set label vertical text alignment.
     139 *
     140 * @param label Label
     141 * @param valign Vertical alignment
     142 */
     143void ui_label_set_valign(ui_label_t *label, gfx_valign_t valign)
     144{
     145        label->valign = valign;
     146}
     147
    138148/** Set label text.
    139149 *
     
    190200        }
    191201
    192         pos.y = label->rect.p0.y;
     202        switch (label->valign) {
     203        case gfx_valign_top:
     204                pos.y = label->rect.p0.y;
     205                break;
     206        case gfx_valign_center:
     207                pos.y = (label->rect.p0.y + label->rect.p1.y) / 2;
     208                break;
     209        case gfx_valign_bottom:
     210                pos.y = label->rect.p1.y;
     211                break;
     212        case gfx_valign_baseline:
     213                return EINVAL;
     214        }
    193215
    194216        gfx_text_fmt_init(&fmt);
Note: See TracChangeset for help on using the changeset viewer.