Changeset 1ebcb791 in mainline


Ignore:
Timestamp:
2021-09-01T19:44:37Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f7c12b3
Parents:
45004f3
Message:

Fill text UI background with color

Location:
uspace/lib/ui
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/private/resource.h

    r45004f3 r1ebcb791  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    5959        bool textmode;
    6060
     61        /** UI background color */
     62        gfx_color_t *ui_bg_color;
     63
    6164        /** Button frame color */
    6265        gfx_color_t *btn_frame_color;
  • uspace/lib/ui/private/ui.h

    r45004f3 r1ebcb791  
    3939
    4040#include <adt/list.h>
     41#include <gfx/coord.h>
    4142#include <display.h>
    4243#include <io/console.h>
     
    5455        /** Display */
    5556        display_t *display;
     57        /** UI rectangle (only used in fullscreen mode) */
     58        gfx_rect_t rect;
    5659        /** Output owned by UI, clean up when destroying UI */
    5760        bool myoutput;
  • uspace/lib/ui/src/resource.c

    r45004f3 r1ebcb791  
    327327                goto error;
    328328
    329         rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff,
    330             &btn_highlight_color);
     329        rc = gfx_color_new_ega(0x20, &btn_highlight_color);
    331330        if (rc != EOK)
    332331                goto error;
  • uspace/lib/ui/src/ui.c

    r45004f3 r1ebcb791  
    3939#include <errno.h>
    4040#include <fibril.h>
     41#include <gfx/color.h>
     42#include <gfx/render.h>
    4143#include <io/console.h>
    4244#include <stdbool.h>
     
    109111        ui_winsys_t ws;
    110112        const char *osvc;
     113        sysarg_t cols;
     114        sysarg_t rows;
    111115        ui_t *ui;
    112116
     
    128132                        return EIO;
    129133
     134                rc = console_get_size(console, &cols, &rows);
     135                if (rc != EOK) {
     136                        console_done(console);
     137                        return rc;
     138                }
     139
    130140                console_cursor_visibility(console, false);
    131141
     
    145155
    146156                ui->cgc = cgc;
     157                ui->rect.p0.x = 0;
     158                ui->rect.p0.y = 0;
     159                ui->rect.p1.x = cols;
     160                ui->rect.p1.y = rows;
     161
     162                (void) ui_paint(ui);
    147163        } else {
    148164                return EINVAL;
     
    284300{
    285301        errno_t rc;
     302        gfx_context_t *gc;
    286303        ui_window_t *awnd;
     304        gfx_color_t *color = NULL;
     305
     306        gc = console_gc_get_ctx(ui->cgc);
     307
     308        rc = gfx_color_new_ega(0x11, &color);
     309        if (rc != EOK)
     310                return rc;
     311
     312        rc = gfx_set_color(gc, color);
     313        if (rc != EOK) {
     314                gfx_color_delete(color);
     315                return rc;
     316        }
     317
     318        rc = gfx_fill_rect(gc, &ui->rect);
     319        if (rc != EOK) {
     320                gfx_color_delete(color);
     321                return rc;
     322        }
     323
     324        gfx_color_delete(color);
    287325
    288326        /* XXX Should repaint all windows */
Note: See TracChangeset for help on using the changeset viewer.