|
TinyMaterialDesign
|
Bottom navigation bar: 3-5 exclusive destinations, each an icon with a label underneath and a pill highlight behind the selected icon. More...
#include <NavigationBar.h>


Public Member Functions | |
| NavigationBar ()=default | |
| NavigationBar (Bounds bounds) | |
| void | addDestination (IconPainter< RGB_T > icon, const char *label) |
| int | selectedIndex () const |
| void | clearSelection () |
| void | setSelectedIndex (int index) |
| void | draw (tinygpu::ISurface< RGB_T > &target) override |
| bool | onGesture (const tinygpu::GestureEvent &event) override |
| Handles one gesture event. Returns true if this widget consumed it. | |
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. | |
Public Attributes | |
| std::function< void(int)> | onChange |
Public Attributes inherited from Widget< RGB_T > | |
| Bounds | bounds |
| bool | visible = true |
| bool | enabled = true |
Additional Inherited Members | |
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 |
Bottom navigation bar: 3-5 exclusive destinations, each an icon with a label underneath and a pill highlight behind the selected icon.
Register with Screen::addFixedWidget() so it stays pinned to the bottom of the viewport while scrollable content behind it scrolls.
|
default |
|
inlineexplicit |
|
inline |
|
inline |
No destination is highlighted (e.g. while a screen outside the navigation is shown); a tap on any destination then selects it.
|
inlineoverridevirtual |
Renders the widget into target using colors/fonts/tokens from its own theme (see theme()/setTheme()).
Implements Widget< RGB_T >.
|
inlineoverridevirtual |
Handles one gesture event. Returns true if this widget consumed it.
Reimplemented from Widget< RGB_T >.
|
inline |
|
inline |
| std::function<void(int)> onChange |
Fired with the new selected index whenever a different destination is tapped.