Styles - JamJar00/JUI GitHub Wiki
Styles describe how components should be drawn on screen; they specify borders and backgrounds.
Usage
style_t style = (style_t){ STYLE_FULL_BORDER, BLACK, DARK_GREY }
button_create(component, style, inner_component, callback);
Predefined Styles
NO_STYLE
is a blank style.
ICONMENU_BUTTON_STYLE
is the built in style for buttons in Icon Menus and will draw a grey border around the button with no background.
LISTVIEW_BUTTON_STYLE
is the built in style for buttons in List Views and will draw grey top and bottom borders with no background.
GRIDVIEW_BUTTON_STYLE
is the built in style for buttons in Grid Views and will draw a grey border with around the button with no background.
Reference
typedef struct {
uint8_t flags;
uint16_t background_color;
uint16_t border_color;
} style_t;
flags
holds a number of predefined options that can be combined together using the boolean operators:
STYLE_NONE
disables the style.STYLE_BACKGROUND
enables drawing of a background.STYLE_TOP_BORDER
enables drawing of the top border.STYLE_BOTTOM_BORDER
enables drawing of the bottom border.STYLE_LEFT_BORDER
enables drawing of the left border.STYLE_RIGHT_BORDER
enables drawing of the right border.STYLE_FULL_BORDER
enables all borders.
style_draw
draws the specified style in the given rectangle.