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