#include <TcThemeBuilder.h>
Public Types | |
enum | ThemeLevel : uint8_t { THEME_GLOBAL , THEME_SUB , THEME_ITEM , THEME_ITEM_NEEDS_PROPS , THEME_ITEM_NEEDS_GRID , THEME_ITEM_NEEDS_BOTH } |
Public Member Functions | |
ThemePropertiesBuilder (TcThemeBuilder *themeBuilder) | |
ThemePropertiesBuilder & | withBorder (const MenuBorder &b) |
ThemePropertiesBuilder & | withAdaFont (const GFXfont *font, int mag=1) |
ThemePropertiesBuilder & | withTcUnicodeFont (const UnicodeFont *font) |
ThemePropertiesBuilder & | withNativeFont (const void *data, uint8_t mag) |
ThemePropertiesBuilder & | withPadding (MenuPadding p) |
ThemePropertiesBuilder & | withSpacing (uint8_t s) |
ThemePropertiesBuilder & | withJustification (GridPosition::GridJustification j) |
ThemePropertiesBuilder & | withPalette (const color_t *p) |
ThemePropertiesBuilder & | withRowHeight (uint16_t height) |
ThemePropertiesBuilder & | withImageOfType (Coord size, DrawableIcon::IconType iconType, const uint8_t *regIcon, const uint8_t *selIcon, const color_t *palette=nullptr) |
ThemePropertiesBuilder & | withImageXbmp (Coord size, const uint8_t *regIcon, const uint8_t *selIcon=nullptr) |
ThemePropertiesBuilder & | withImage2bpp (Coord size, const color_t *imgPalette, const uint8_t *regIcon, const uint8_t *selIcon=nullptr) |
ThemePropertiesBuilder & | withImage4bpp (Coord size, const color_t *imgPalette, const uint8_t *regIcon, const uint8_t *selIcon=nullptr) |
ThemePropertiesBuilder & | withMonoBitmap (Coord size, const uint8_t *regIcon, const uint8_t *selIcon=nullptr) |
ThemePropertiesBuilder & | withDrawingMode (GridPosition::GridDrawingMode dm) |
ThemePropertiesBuilder & | onRowCol (uint8_t actRow, uint8_t column, uint8_t numberOfCols) |
ThemePropertiesBuilder & | onRow (uint8_t actualRow) |
void | apply () |
Protected Member Functions | |
void | initForLevel (TcThemeBuilder *b, ItemDisplayProperties::ComponentType compType, ThemeLevel level, MenuItem *item=nullptr) |
void | needsProps () |
void | needsGrid (bool propsOk) |
Protected Attributes | |
friend | TcThemeBuilder |
Represents a set of theme properties that can be applied at any level, if at the item level, this class can also create grid layout. You normally don't create these directly, instead one is normally provided from builder, using the various properties/override methods. This class uses builder syntax, so most methods other than apply
can be chained together as the methods return a reference to the same object.
|
inline |
Sets the border to something other than the default
b | the border |
|
inline |
Sets the font to be an adafruit font
font | the font to use |
mag | an optional magnification (default 1) |
|
inline |
Sets the font to be a tcUnicode font
font | the font to use |
|
inline |
Sets the font to be a native font, IE any font whatsoever
font | the font to use |
mag | the magnification value |
|
inline |
Sets the padding to a custom value
p | the padding to apply |
|
inline |
Sets the spacing to a custom value
s | the spacing to apply |
|
inline |
Sets the justification to be a custom value
j | the justification to apply |
|
inline |
Sets the palette to a custom value, other than the default
p | the padding to apply |
|
inline |
Sets the row height directly for a given menu item. Only applicable at the menu item level, and only needed if you don't want to use calculated heights.
height | the height to apply |
ThemePropertiesBuilder & ThemePropertiesBuilder::withImageOfType | ( | Coord | size, |
DrawableIcon::IconType | iconType, | ||
const uint8_t * | regIcon, | ||
const uint8_t * | selIcon, | ||
const color_t * | palette = nullptr |
||
) |
A somewhat internal method that allows for all withImage.. calls to be simplified.
|
inline |
For item level use only, this sets the menu item to render as an image, instead of as text. Xbmp format is a byte packed array in LSB first order. IE (0,0) is MSB of byte 1.
size | size of the images provided |
regIcon | the icon when not active / edited |
selIcon | the icon when selected, IE active / edited |
|
inline |
For item level use only, this sets the menu item to render as an image with 2 bits per pixel, that is the each color index defined by each 2 bits maps to en entry in the palette.
size | size of the images provided |
palette | the palette for each color index, must be color_t array of size 4 |
regIcon | the icon when not active / edited |
selIcon | the icon when selected, IE active / edited |
|
inline |
For item level use only, this sets the menu item to render as an image with 4 bits per pixel, that is the each color index defined by each 4 bits maps to en entry in the palette.
size | size of the images provided |
palette | the palette for each color index, must be color_t array of size 16 |
regIcon | the icon when not active / edited |
selIcon | the icon when selected, IE active / edited |
|
inline |
For item level use only, this sets the menu item to render as a mono bitmap, instead of as text. Mono bitmaps are byte packed arrays in MSB first order. IE (0,0) is LSB of byte 1.
size | size of the images provided |
regIcon | the icon when not active / edited |
selIcon | the icon when selected, IE active / edited |
|
inline |
Sets the drawing mode to use that overrides the default
dm | the drawing mode |
|
inline |
Sets the column index and number of columns on the row. Note that each entry on the row must properly set the same number of columns. If you don't need to specify the column, prefer using onRow(n) instead.
actualRow | the row where the item should appear |
numberOfCols | the number of columns across |
column | the column number |
|
inline |
Sets the row that an item should appear on, used when there is a single column on the row. Use this when there is only one item on the row as the column will be defaulted to column 1 spanning the row.
actualRow | the row number |
void ThemePropertiesBuilder::apply | ( | ) |
Call this after all other settings have been configured, this will actually put the newly created properties into the factory for later use. Important: Without calling this the changes will not be applied.