diff options
-rw-r--r-- | src/gui/text_widget.c | 12 | ||||
-rw-r--r-- | src/kernel/kernel.c | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/text_widget.c b/src/gui/text_widget.c index 6071fd1..64bf161 100644 --- a/src/gui/text_widget.c +++ b/src/gui/text_widget.c @@ -40,16 +40,18 @@ void text_widget_draw( void *obj, graphics_context_t *context ) int x = 0; int y = 0; + int w = 0; + int h = 0; widget->base.vtable->model_to_screen( widget, &x, &y ); for( const char *p = widget->s; *p != '\0'; p++ ) { - vga_draw_char( context, *p, x, y, widget->base.background_color, + vga_draw_char( context, *p, x + w, y + h, widget->base.background_color, VGA_COLOR_WHITE ); - x += 9; - if( x >= widget->base.w - 9 ) { - y += 16; - x = 0; + w += 9; + if( w >= widget->base.w - 9 ) { + h += 16; + w = 0; } } diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 99a162b..b17baf4 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -215,7 +215,7 @@ static void handle_keyboard_event( keyboard_event_t *event, void *context ) } *p = '\0'; text_widget_t widget3; - text_widget_init( &widget3, (widget_t *)&desktop, 5, 5, vga->mode.x - 10 , 100, VGA_COLOR_RED, s ); + text_widget_init( &widget3, (widget_t *)&desktop, 55, 5, vga->mode.x - 65 , 100, VGA_COLOR_RED, s ); ((composite_widget_vtable_t *)desktop.vtable)->add_child( &desktop, (widget_t *)&widget3 ); // as vga_t is equals to the graphical context for now |