Changeset 03145ee in mainline for uspace/lib/ui/src/resource.c


Ignore:
Timestamp:
2020-11-10T09:00:48Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d942ca4
Parents:
0d71fd6
git-author:
Jiri Svoboda <jiri@…> (2020-11-09 20:00:37)
git-committer:
Jiri Svoboda <jiri@…> (2020-11-10 09:00:48)
Message:

Add UI text entry (read-only)

We use the read-only text entry to display calculator output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/resource.c

    r0d71fd6 r03145ee  
    7474        gfx_color_t *tbar_act_text_color = NULL;
    7575        gfx_color_t *tbar_inact_text_color = NULL;
     76        gfx_color_t *entry_fg_color = NULL;
     77        gfx_color_t *entry_bg_color = NULL;
    7678        errno_t rc;
    7779
     
    156158        rc = gfx_color_new_rgb_i16(0x5858, 0x5858, 0x5858,
    157159            &tbar_inact_text_color);
     160        if (rc != EOK)
     161                goto error;
     162
     163        rc = gfx_color_new_rgb_i16(0, 0, 0, &entry_fg_color);
     164        if (rc != EOK)
     165                goto error;
     166
     167        rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &entry_bg_color);
    158168        if (rc != EOK)
    159169                goto error;
     
    180190        resource->tbar_inact_bg_color = tbar_inact_bg_color;
    181191        resource->tbar_inact_text_color = tbar_inact_text_color;
     192
     193        resource->entry_fg_color = entry_fg_color;
     194        resource->entry_bg_color = entry_bg_color;
    182195
    183196        *rresource = resource;
     
    217230                gfx_color_delete(tbar_inact_text_color);
    218231
     232        if (entry_fg_color != NULL)
     233                gfx_color_delete(entry_fg_color);
     234        if (entry_bg_color != NULL)
     235                gfx_color_delete(entry_bg_color);
     236
    219237        if (tface != NULL)
    220238                gfx_typeface_destroy(tface);
     
    250268        gfx_color_delete(resource->tbar_inact_text_color);
    251269
     270        gfx_color_delete(resource->entry_fg_color);
     271        gfx_color_delete(resource->entry_bg_color);
     272
    252273        gfx_font_close(resource->font);
    253274        gfx_typeface_destroy(resource->tface);
Note: See TracChangeset for help on using the changeset viewer.