36 void draw()
const override;
37 void update(time_t time_ms)
override;
59 DERIVE_EVENT_HANDLERS(
Panel)
A basic widget that displays a rounded rectangle behind another widget.
Definition panel.hpp:18
void drawDone() override
Reset any state variables after rendering has finished.
color_t getColor() const
Get the current widget color.
Panel(Widget *child, color_t color, const Size &size={0, 0}, radius_t borderRadius=0, const Position &pos={0, 0}, const Alignment &align={ALIGN_LEFT, ALIGN_TOP}, const Padding &padding={0})
Construct a panel with optional configuration.
void setColor(color_t new_color)
Set the panel color.
Size size() const override
Get the size of the widget.
void draw() const override
Render the widget to the screen.
void setBorderRadius(radius_t new_radius)
Set the border radius.
void update(time_t time_ms) override
Update any internal state of the widget, and check if it needs to be re-rendered.
uint16_t color_t
An RGB565 color value. 5 bits red, 6 bits green, 5 bits blue.
Definition color.hpp:13
uint16_t radius_t
A non-negative size for the pixel radius of curved shapes.
Definition radius.hpp:12
A struct that holds the normalized position of a widget.
Definition position.hpp:15
A struct that holds the number of pixels that a widget would take up on the screen.
Definition size.hpp:17