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


Ignore:
Timestamp:
2022-03-07T21:07:02Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
96c6a00
Parents:
4583015
Message:

Rendering UI text with highlighted accelerators

File:
1 edited

Legend:

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

    r4583015 rca2680d  
    11/*
    2  * Copyright (c) 2021 Jiri Svoboda
     2 * Copyright (c) 2022 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    6767        gfx_color_t *wnd_face_color = NULL;
    6868        gfx_color_t *wnd_text_color = NULL;
     69        gfx_color_t *wnd_text_hgl_color = NULL;
    6970        gfx_color_t *wnd_sel_text_color = NULL;
     71        gfx_color_t *wnd_sel_text_hgl_color = NULL;
    7072        gfx_color_t *wnd_sel_text_bg_color = NULL;
    7173        gfx_color_t *wnd_frame_hi_color = NULL;
     
    131133                goto error;
    132134
     135        rc = gfx_color_new_rgb_i16(0, 0, 0, &wnd_text_hgl_color);
     136        if (rc != EOK)
     137                goto error;
     138
    133139        rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &wnd_sel_text_color);
     140        if (rc != EOK)
     141                goto error;
     142
     143        rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff,
     144            &wnd_sel_text_hgl_color);
    134145        if (rc != EOK)
    135146                goto error;
     
    210221        resource->wnd_face_color = wnd_face_color;
    211222        resource->wnd_text_color = wnd_text_color;
     223        resource->wnd_text_hgl_color = wnd_text_hgl_color;
    212224        resource->wnd_sel_text_color = wnd_sel_text_color;
     225        resource->wnd_sel_text_hgl_color = wnd_sel_text_hgl_color;
    213226        resource->wnd_sel_text_bg_color = wnd_sel_text_bg_color;
    214227        resource->wnd_frame_hi_color = wnd_frame_hi_color;
     
    246259        if (wnd_text_color != NULL)
    247260                gfx_color_delete(wnd_text_color);
     261        if (wnd_text_hgl_color != NULL)
     262                gfx_color_delete(wnd_text_hgl_color);
    248263        if (wnd_sel_text_color != NULL)
    249264                gfx_color_delete(wnd_sel_text_color);
     265        if (wnd_sel_text_hgl_color != NULL)
     266                gfx_color_delete(wnd_sel_text_hgl_color);
    250267        if (wnd_sel_text_bg_color != NULL)
    251268                gfx_color_delete(wnd_sel_text_bg_color);
     
    304321        gfx_color_t *wnd_face_color = NULL;
    305322        gfx_color_t *wnd_text_color = NULL;
     323        gfx_color_t *wnd_text_hgl_color = NULL;
    306324        gfx_color_t *wnd_sel_text_color = NULL;
     325        gfx_color_t *wnd_sel_text_hgl_color = NULL;
    307326        gfx_color_t *wnd_sel_text_bg_color = NULL;
    308327        gfx_color_t *wnd_frame_hi_color = NULL;
     
    362381                goto error;
    363382
     383        rc = gfx_color_new_ega(0x74, &wnd_text_hgl_color);
     384        if (rc != EOK)
     385                goto error;
     386
    364387        rc = gfx_color_new_ega(0x07, &wnd_sel_text_color);
     388        if (rc != EOK)
     389                goto error;
     390
     391        rc = gfx_color_new_ega(0x04, &wnd_sel_text_hgl_color);
    365392        if (rc != EOK)
    366393                goto error;
     
    435462        resource->wnd_face_color = wnd_face_color;
    436463        resource->wnd_text_color = wnd_text_color;
     464        resource->wnd_text_hgl_color = wnd_text_hgl_color;
    437465        resource->wnd_sel_text_color = wnd_sel_text_color;
     466        resource->wnd_sel_text_hgl_color = wnd_sel_text_hgl_color;
    438467        resource->wnd_sel_text_bg_color = wnd_sel_text_bg_color;
    439468        resource->wnd_frame_hi_color = wnd_frame_hi_color;
     
    471500        if (wnd_text_color != NULL)
    472501                gfx_color_delete(wnd_text_color);
     502        if (wnd_text_hgl_color != NULL)
     503                gfx_color_delete(wnd_text_hgl_color);
    473504        if (wnd_sel_text_color != NULL)
    474505                gfx_color_delete(wnd_sel_text_color);
     506        if (wnd_sel_text_hgl_color != NULL)
     507                gfx_color_delete(wnd_sel_text_hgl_color);
    475508        if (wnd_sel_text_bg_color != NULL)
    476509                gfx_color_delete(wnd_sel_text_bg_color);
Note: See TracChangeset for help on using the changeset viewer.