diff --git a/src/widget_default.c b/src/widget_default.c index dcea81a..e8dfca7 100644 --- a/src/widget_default.c +++ b/src/widget_default.c @@ -2,12 +2,12 @@ #include "tft.h" #include "mongoose-touch.h" -static void widget_default_draw(struct widget_t *w) { +static void widget_default_draw(struct widget_t *w, color_t color) { if (!w) return; mgos_ili9341_setclipwin(w->x, w->y, w->x+w->w, w->y+w->h); - mgos_ili9341_drawRect(0, 0, w->w, w->h, ILI9341_GREEN); + mgos_ili9341_drawRoundRect(0, 0, w->w, w->h, 8, color); if (w->img) mgos_ili9341_png(0, 0, w->img); @@ -28,9 +28,11 @@ void widget_default_ev(int ev, struct widget_t *w, void *ev_data) { case EV_WIDGET_REDRAW: case EV_WIDGET_TIMER: case EV_WIDGET_TOUCH_UP: - widget_default_draw(w); + widget_default_draw(w, ILI9341_GREEN); break; case EV_WIDGET_TOUCH_DOWN: + widget_default_draw(w, ILI9341_RED); + break; case EV_WIDGET_DESTROY: default: // EV_WIDGET_NONE break;