diff options
author | Uros Majstorovic <majstor@majstor.org> | 2022-08-09 22:23:08 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2022-08-09 22:23:08 +0200 |
commit | 3f913efda03fd840cd526ef72e6f397c7da61bd7 (patch) | |
tree | 08f62c93e0e0660fdb7beba32276ff1ceb7a8a3c /fw/fe310/eos/eve/widget/label.c | |
parent | 810dde21ee65653c15606917b19566cfbaaf165e (diff) |
code layout
Diffstat (limited to 'fw/fe310/eos/eve/widget/label.c')
-rw-r--r-- | fw/fe310/eos/eve/widget/label.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fw/fe310/eos/eve/widget/label.c b/fw/fe310/eos/eve/widget/label.c index f2d2e8e..43d555d 100644 --- a/fw/fe310/eos/eve/widget/label.c +++ b/fw/fe310/eos/eve/widget/label.c @@ -16,6 +16,13 @@ void eve_label_init(EVELabel *label, EVERect *g, EVEFont *font, char *title) { label->font = font; label->title = title; if (label->g.h == 0) label->g.h = eve_font_h(font); + if (label->g.w == 0) label->g.w = eve_font_str_w(font, label->title) + EVE_LABEL_MARGIN; +} + +void eve_label_create(EVELabel *label, EVELabelSpec *spec, EVEPage *page) { + EVEFont *font = spec->font ? spec->font : eve_window_font(page->v.window); + + eve_label_init(label, &spec->g, font, spec->title); } void eve_label_draw(EVELabel *label) { |