Changes in uspace/lib/gui/button.c [296e124e:2cc1ec0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/button.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 "common.h" 41 43 #include "window.h" … … 76 78 sysarg_t cpt_width; 77 79 sysarg_t cpt_height; 78 font_get_box( &btn->font, btn->caption, &cpt_width, &cpt_height);80 font_get_box(btn->font, btn->caption, &cpt_width, &cpt_height); 79 81 80 82 if ((widget->width >= cpt_width) && (widget->height >= cpt_height)) { … … 83 85 84 86 drawctx_set_source(&drawctx, &btn->text); 85 drawctx_set_font(&drawctx, &btn->font);87 drawctx_set_font(&drawctx, btn->font); 86 88 87 89 if (btn->caption) … … 96 98 widget_deinit(&btn->widget); 97 99 free(btn->caption); 98 font_release( &btn->font);100 font_release(btn->font); 99 101 } 100 102 … … 171 173 btn->caption = str_dup(caption); 172 174 173 font_init(&btn->font, FONT_DECODER_EMBEDDED, NULL, points); 175 int rc = embedded_font_create(&btn->font, points); 176 if (rc != EOK) { 177 free(btn->caption); 178 btn->caption = NULL; 179 return false; 180 } 174 181 175 182 sysarg_t cpt_width; 176 183 sysarg_t cpt_height; 177 font_get_box( &btn->font, btn->caption, &cpt_width, &cpt_height);184 font_get_box(btn->font, btn->caption, &cpt_width, &cpt_height); 178 185 btn->widget.width_min = cpt_width + 10; 179 186 btn->widget.height_min = cpt_height + 10;
Note:
See TracChangeset
for help on using the changeset viewer.