Events for modular UI and other listeners

This commit is contained in:
Sassa NF
2024-10-05 16:35:01 +01:00
parent 0c760610df
commit bdd00039b2
9 changed files with 175 additions and 50 deletions
+12 -1
View File
@@ -12,7 +12,8 @@ size_t StackedChart::addChart(Chart *c)
cc[charts_sz] = c;
free(charts);
c->reset(pos_x + c->pos_x, pos_y + c->pos_y, trim_w(c->pos_x, c->width, width), c->height);
c->reset(pos_x + c->pos_x, pos_y + c->pos_y, trim_w(c->pos_x, c->width, width),
c->height);
charts = cc;
return charts_sz++;
}
@@ -82,3 +83,13 @@ void StackedChart::draw()
for (int i = 0; i < charts_sz; i++)
charts[i]->draw();
}
void StackedChart::onEvent(Event &e)
{
if (e.type != SCAN_TASK_COMPLETE)
{
return;
}
draw();
}