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