Changeset 15d0046 in mainline for uspace/lib/gui/label.c


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r8db09e4 r15d0046  
    3838#include <drawctx.h>
    3939#include <surface.h>
     40#include <font/embedded.h>
     41#include <errno.h>
    4042#include "window.h"
    4143#include "label.h"
     
    5860        sysarg_t cpt_width;
    5961        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);
    6163       
    6264        if ((widget->width >= cpt_width) && (widget->height >= cpt_height)) {
     
    6567               
    6668                drawctx_set_source(&drawctx, &lbl->text);
    67                 drawctx_set_font(&drawctx, &lbl->font);
     69                drawctx_set_font(&drawctx, lbl->font);
    6870               
    6971                if (lbl->caption)
     
    8486                sysarg_t cpt_width;
    8587                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);
    8789               
    8890                lbl->widget.width_min = cpt_width + 4;
     
    99101        widget_deinit(&lbl->widget);
    100102        free(lbl->caption);
    101         font_release(&lbl->font);
     103        font_release(lbl->font);
    102104}
    103105
     
    161163                lbl->caption = str_dup(caption);
    162164       
    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        }
    164171       
    165172        sysarg_t cpt_width;
    166173        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);
    168175       
    169176        lbl->widget.width_min = cpt_width + 4;
Note: See TracChangeset for help on using the changeset viewer.