Top app bar: a title plus optional leading/trailing icon widgets (typically IconButton).
More...
#include <AppBar.h>
template<typename RGB_T = TINYMD_DEFAULT_RGB_T>
class tinymd::AppBar< RGB_T >
Top app bar: a title plus optional leading/trailing icon widgets (typically IconButton).
leading/trailing are children AppBar forwards draw()/update()/ onGesture() to internally - do not also add them to Screen directly, or they'd be hit-tested twice. Position them with leadingRect()/ trailingRect() before attaching.
◆ AppBar() [1/2]
◆ AppBar() [2/2]
◆ clearColorOverride()
| void clearColorOverride |
( |
| ) |
|
|
inline |
◆ draw()
| void draw |
( |
tinygpu::ISurface< RGB_T > & |
target | ) |
|
|
inlineoverridevirtual |
Renders the widget into target using colors/fonts/tokens from its own theme (see theme()/setTheme()).
Implements Widget< RGB_T >.
◆ leadingRect()
Suggested square icon slot at the bar's left edge.
◆ onGesture()
| bool onGesture |
( |
const tinygpu::GestureEvent & |
event | ) |
|
|
inlineoverridevirtual |
Handles one gesture event. Returns true if this widget consumed it.
Reimplemented from Widget< RGB_T >.
◆ setColorOverride()
| void setColorOverride |
( |
RGB_T |
background, |
|
|
RGB_T |
foreground |
|
) |
| |
|
inline |
Overrides the theme's surface/onSurface colors for this bar only - e.g. a blue title bar while the rest of the screen stays on the default theme. Call clearColorOverride() to go back to theme.colors.surface.
◆ setTitle()
| void setTitle |
( |
const char * |
title | ) |
|
|
inline |
◆ trailingRect()
Suggested square icon slot at the bar's right edge.
◆ update()
| bool update |
( |
uint32_t |
nowMs | ) |
|
|
inlineoverridevirtual |
Called once per frame, before draw(), to advance any time-based animation (ripple fade, indeterminate progress sweep, ...). Returns true if that advance changed anything this widget will draw differently, so Screen can decide whether a redraw is actually needed - see Screen::isDirty(). Default: no-op, not dirty, so widgets that don't animate cost nothing extra.
Reimplemented from Widget< RGB_T >.
◆ leading
| Widget<RGB_T>* leading = nullptr |
◆ trailing
| Widget<RGB_T>* trailing = nullptr |
The documentation for this class was generated from the following file: