34 lines
730 B
C
34 lines
730 B
C
#include "mgos.h"
|
|
#include "tft.h"
|
|
#include "mongoose-touch.h"
|
|
|
|
static void widget_topbar_render(struct widget_t *w, void *ev_data) {
|
|
if (!w)
|
|
return;
|
|
|
|
mgos_ili9341_setclipwin(w->x, w->y, w->x+w->w, w->y+w->h);
|
|
mgos_ili9341_fillRect(0, 0, w->w, w->h, ILI9341_WHITE);
|
|
mgos_ili9341_resetclipwin();
|
|
|
|
(void) ev_data;
|
|
}
|
|
|
|
void widget_topbar_ev(int ev, struct widget_t *w, void *ev_data) {
|
|
if (!w)
|
|
return;
|
|
|
|
switch(ev) {
|
|
case EV_WIDGET_CREATE:
|
|
case EV_WIDGET_DRAW:
|
|
case EV_WIDGET_REDRAW:
|
|
case EV_WIDGET_TIMER:
|
|
widget_topbar_render(w, ev_data);
|
|
break;
|
|
case EV_WIDGET_TOUCH_UP:
|
|
case EV_WIDGET_TOUCH_DOWN:
|
|
case EV_WIDGET_DESTROY:
|
|
default: // EV_WIDGET_NONE
|
|
break;
|
|
}
|
|
}
|