Changeset 8a9a41e in mainline for uspace/lib/ui/src/label.c
- Timestamp:
- 2021-10-24T08:28:43Z (2 years ago)
- Children:
- fcb4e15
- Parents:
- 2ce943a (diff), cd981f2a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Erik Kučák <35500848+Riko196@…> (2021-10-24 08:28:43)
- git-committer:
- GitHub <noreply@…> (2021-10-24 08:28:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/label.c
r2ce943a r8a9a41e 136 136 } 137 137 138 /** Set label vertical text alignment. 139 * 140 * @param label Label 141 * @param valign Vertical alignment 142 */ 143 void ui_label_set_valign(ui_label_t *label, gfx_valign_t valign) 144 { 145 label->valign = valign; 146 } 147 138 148 /** Set label text. 139 149 * … … 190 200 } 191 201 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 } 193 215 194 216 gfx_text_fmt_init(&fmt);
Note:
See TracChangeset
for help on using the changeset viewer.