diff options
author | Marvin Borner | 2021-04-27 23:32:05 +0200 |
---|---|---|
committer | Marvin Borner | 2021-04-27 23:32:05 +0200 |
commit | 895a58b1b57a0ae8028576404a90f12e0133cf5f (patch) | |
tree | 0130860f90ffd69b493f540987dc992257b5f974 /libs/libgui/gui.c | |
parent | 51a80930a9bc25fae0728994cab1e0df3b63ef48 (diff) |
Chess (-> and libgui) improvements
Diffstat (limited to 'libs/libgui/gui.c')
-rw-r--r-- | libs/libgui/gui.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libs/libgui/gui.c b/libs/libgui/gui.c index 046e8bf..891a0e4 100644 --- a/libs/libgui/gui.c +++ b/libs/libgui/gui.c @@ -120,6 +120,22 @@ static void gui_connect_wm(void) * GFX wrappers */ +res gui_clear(u32 win_id, u32 widget_id, enum gui_layer layer) +{ + struct gui_widget *widget = gui_widget_by_id(win_id, widget_id); + if (!widget) + return_errno(ENOENT); + + if (layer == GUI_LAYER_BG) + gfx_clear(&widget->bg); + else if (layer == GUI_LAYER_FG) + gfx_clear(&widget->fg); + else + return_errno(EINVAL); + + return_errno(EOK); +} + res gui_fill(u32 win_id, u32 widget_id, enum gui_layer layer, u32 c) { struct gui_widget *widget = gui_widget_by_id(win_id, widget_id); @@ -243,8 +259,8 @@ static res gui_sync_sub_widgets(struct gui_widget *widget) struct node *iterator = widget->children->head; while (iterator) { struct gui_widget *w = iterator->data; - gfx_ctx_on_ctx(&widget->bg, &w->bg, w->pos, GFX_ALPHA); - gfx_ctx_on_ctx(&widget->fg, &w->fg, w->pos, GFX_ALPHA); + gfx_ctx_on_ctx(&widget->bg, &w->bg, w->pos, GFX_NON_ALPHA); + gfx_ctx_on_ctx(&widget->fg, &w->fg, w->pos, GFX_NON_ALPHA); iterator = iterator->next; } |