|
TinyMaterialDesign
|
Single line of themed, non-interactive text. More...
#include <Label.h>


Public Member Functions | |
| Label ()=default | |
| Label (Bounds bounds, const char *text, TypographyRole role=TypographyRole::kBody, TextAlign align=TextAlign::kStart) | |
| void | setText (const char *text) |
| const std::string & | text () const |
| void | setRole (TypographyRole role) |
| void | setAlign (TextAlign align) |
| void | setColor (RGB_T color) |
| void | setBackgroundColor (RGB_T color) |
| void | setOnBackground (bool onBackground) |
| Draw the text on the theme's page background instead of the surface. | |
| void | setVariantColor (bool variant) |
| void | setFont (tinygpu::IFont< RGB_T > *font) |
| tinygpu::IFont< RGB_T > * | font () const |
| void | draw (tinygpu::ISurface< RGB_T > &target) override |
Public Member Functions inherited from Widget< RGB_T > | |
| virtual | ~Widget ()=default |
| virtual void | setTheme (const MaterialTheme< RGB_T > &theme) |
| virtual void | draw (tinygpu::ISurface< RGB_T > &target)=0 |
| virtual bool | onGesture (const tinygpu::GestureEvent &event) |
| Handles one gesture event. Returns true if this widget consumed it. | |
| virtual bool | update (uint32_t nowMs) |
| virtual bool | isDraggable () const |
| virtual bool | isDraggableAt (int32_t x, int32_t y) const |
| virtual int | childCount () const |
| virtual Widget< RGB_T > * | child (int index) |
| virtual void | drawBackground (tinygpu::ISurface< RGB_T > &target) |
| virtual void | setThemeTint (RGB_T background, RGB_T foreground) |
| virtual bool | isContainer () const |
| Provides true if the widget is a container. | |
Additional Inherited Members | |
Public Attributes inherited from Widget< RGB_T > | |
| Bounds | bounds |
| bool | visible = true |
| bool | enabled = true |
Protected Member Functions inherited from Widget< RGB_T > | |
| const MaterialTheme< RGB_T > & | theme () const |
| Convenience accessor for draw() overrides - see theme_. | |
Protected Attributes inherited from Widget< RGB_T > | |
| const MaterialTheme< RGB_T > * | theme_ = nullptr |
Single line of themed, non-interactive text.
|
default |
|
inline |
|
inlineoverridevirtual |
Renders the widget into target using colors/fonts/tokens from its own theme (see theme()/setTheme()).
Implements Widget< RGB_T >.
|
inline |
|
inline |
|
inline |
Color behind the text (default: the surface color of the theme). Use the background color for a label directly on a page.
|
inline |
|
inline |
Explicit font, taking priority over the role-derived one in draw() below - nullptr (the default) means "use the theme's font for role()".
|
inline |
Draw the text on the theme's page background instead of the surface.
|
inline |
|
inline |
|
inline |
Secondary text: the theme's onSurfaceVariant color instead of onSurface (ignored if a color was set with setColor()).
|
inline |