Changeset c9a7adc in mainline for uspace/app/uidemo/uidemo.c


Ignore:
Timestamp:
2020-10-14T17:32:49Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4ed00d3
Parents:
f6df5a3
Message:

3D button frame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/uidemo/uidemo.c

    rf6df5a3 rc9a7adc  
    3434
    3535#include <display.h>
     36#include <gfx/color.h>
     37#include <gfx/coord.h>
     38#include <gfx/render.h>
    3639#include <stdio.h>
    3740#include <str.h>
     
    135138        ui_demo_t demo;
    136139        gfx_rect_t rect;
     140        gfx_color_t *color = NULL;
    137141        errno_t rc;
    138142
     
    184188        ui_pbutton_set_rect(demo.pb1, &rect);
    185189
     190        ui_pbutton_set_default(demo.pb1, true);
     191
    186192        rc = ui_pbutton_create(ui_res, "Cancel", &demo.pb2);
    187193        if (rc != EOK) {
     
    195201        rect.p1.y = 80;
    196202        ui_pbutton_set_rect(demo.pb2, &rect);
     203
     204        rc = gfx_color_new_rgb_i16(0xc8c8, 0xc8c8, 0xc8c8, &color);
     205        if (rc != EOK) {
     206                printf("Error allocating color.\n");
     207                return rc;
     208        }
     209
     210        rc = gfx_set_color(gc, color);
     211        if (rc != EOK) {
     212                printf("Error setting color.\n");
     213                return rc;
     214        }
     215
     216        rc = gfx_fill_rect(gc, &params.rect);
     217        if (rc != EOK) {
     218                printf("Error filling background.\n");
     219                return rc;
     220        }
     221
     222        gfx_color_delete(color);
     223        color = NULL;
    197224
    198225        rc = ui_pbutton_paint(demo.pb1);
Note: See TracChangeset for help on using the changeset viewer.