Changes in uspace/lib/gui/label.c [296e124e:2cc1ec0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/label.c
r296e124e r2cc1ec0 38 38 #include <drawctx.h> 39 39 #include <surface.h> 40 #include <font/embedded.h> 41 #include <errno.h> 40 42 #include "window.h" 41 43 #include "label.h" … … 58 60 sysarg_t cpt_width; 59 61 sysarg_t cpt_height; 60 font_get_box( &lbl->font, lbl->caption, &cpt_width, &cpt_height);62 font_get_box(lbl->font, lbl->caption, &cpt_width, &cpt_height); 61 63 62 64 if ((widget->width >= cpt_width) && (widget->height >= cpt_height)) { … … 65 67 66 68 drawctx_set_source(&drawctx, &lbl->text); 67 drawctx_set_font(&drawctx, &lbl->font);69 drawctx_set_font(&drawctx, lbl->font); 68 70 69 71 if (lbl->caption) … … 84 86 sysarg_t cpt_width; 85 87 sysarg_t cpt_height; 86 font_get_box( &lbl->font, lbl->caption, &cpt_width, &cpt_height);88 font_get_box(lbl->font, lbl->caption, &cpt_width, &cpt_height); 87 89 88 90 lbl->widget.width_min = cpt_width + 4; … … 99 101 widget_deinit(&lbl->widget); 100 102 free(lbl->caption); 101 font_release( &lbl->font);103 font_release(lbl->font); 102 104 } 103 105 … … 161 163 lbl->caption = str_dup(caption); 162 164 163 font_init(&lbl->font, FONT_DECODER_EMBEDDED, NULL, points); 165 int rc = embedded_font_create(&lbl->font, points); 166 if (rc != EOK) { 167 free(lbl->caption); 168 lbl->caption = NULL; 169 return false; 170 } 164 171 165 172 sysarg_t cpt_width; 166 173 sysarg_t cpt_height; 167 font_get_box( &lbl->font, lbl->caption, &cpt_width, &cpt_height);174 font_get_box(lbl->font, lbl->caption, &cpt_width, &cpt_height); 168 175 169 176 lbl->widget.width_min = cpt_width + 4;
Note:
See TracChangeset
for help on using the changeset viewer.