summaryrefslogtreecommitdiff
path: root/src/gui/widget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widget.c')
-rw-r--r--src/gui/widget.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/widget.c b/src/gui/widget.c
index cd77d03..1c26680 100644
--- a/src/gui/widget.c
+++ b/src/gui/widget.c
@@ -15,7 +15,7 @@ static widget_vtable_t widget_vtable = {
widget_on_key_up
};
-void widget_init( widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h )
+void widget_init( widget_t *widget, widget_t *parent, const int x, const int y, const int w, const int h, const vga_color_t background_color )
{
memset( widget, 0, sizeof( widget_t ) );
@@ -24,6 +24,7 @@ void widget_init( widget_t *widget, widget_t *parent, const int x, const int y,
widget->y = y;
widget->w = w;
widget->h = h;
+ widget->background_color = background_color;
widget->vtable = &widget_vtable;
}
@@ -37,7 +38,7 @@ void widget_draw( void *obj, graphics_context_t *context )
widget->vtable->model_to_screen( widget, &x, &y );
vga_draw_rectangle( context, x, y, widget->w, widget->h,
- vga_make_RGB( 0xFF, 0xFF, 0xFF ) );
+ widget->background_color );
}
void widget_get_focus( void *obj, widget_t *widget )