Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gui/button.c

    r2cc1ec0 r296e124e  
    3838#include <drawctx.h>
    3939#include <surface.h>
    40 #include <font/embedded.h>
    41 #include <errno.h>
    4240#include "common.h"
    4341#include "window.h"
     
    7876        sysarg_t cpt_width;
    7977        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);
    8179       
    8280        if ((widget->width >= cpt_width) && (widget->height >= cpt_height)) {
     
    8583               
    8684                drawctx_set_source(&drawctx, &btn->text);
    87                 drawctx_set_font(&drawctx, btn->font);
     85                drawctx_set_font(&drawctx, &btn->font);
    8886               
    8987                if (btn->caption)
     
    9896        widget_deinit(&btn->widget);
    9997        free(btn->caption);
    100         font_release(btn->font);
     98        font_release(&btn->font);
    10199}
    102100
     
    173171                btn->caption = str_dup(caption);
    174172       
    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);
    181174       
    182175        sysarg_t cpt_width;
    183176        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);
    185178        btn->widget.width_min = cpt_width + 10;
    186179        btn->widget.height_min = cpt_height + 10;
Note: See TracChangeset for help on using the changeset viewer.