Tactility/Modules/lvgl-module/source/themes/lv_theme_material.c
Ken Van Hoeylandt 7638602201 Theming WIP
2026-10-06 23:04:31 +02:00

2229 lines
95 KiB
C

/* Generated by LSS. Do not edit. */
#define LV_USE_PRIVATE_API 1 /* For lv_theme_t */
#include "lv_theme_material.h"
/*********************
* DEFINES
*********************/
extern const lv_obj_class_t lvgl_toolbar_class;
extern const lv_obj_class_t lvgl_icon_button_class;
extern const lv_obj_class_t lvgl_icon_button_filled_class;
extern const lv_obj_class_t lvgl_icon_button_tonal_class;
extern const lv_obj_class_t lvgl_sliderbox_class;
extern const lv_obj_class_t lvgl_card_class;
#define NEUTRAL_4 lv_color_hex(0x0E0E0E)
#define NEUTRAL_6 lv_color_hex(0x131313)
#define NEUTRAL_10 lv_color_hex(0x1C1C1C)
#define NEUTRAL_12 lv_color_hex(0x1F1F1F)
#define NEUTRAL_17 lv_color_hex(0x2B2B2B)
#define NEUTRAL_20 lv_color_hex(0x303030)
#define NEUTRAL_22 lv_color_hex(0x343434)
#define NEUTRAL_30 lv_color_hex(0x474747)
#define NEUTRAL_50 lv_color_hex(0x777777)
#define NEUTRAL_60 lv_color_hex(0x919191)
#define NEUTRAL_80 lv_color_hex(0xC6C6C6)
#define NEUTRAL_90 lv_color_hex(0xE2E2E2)
#define NEUTRAL_92 lv_color_hex(0xE8E8E8)
#define NEUTRAL_94 lv_color_hex(0xEEEEEE)
#define NEUTRAL_95 lv_color_hex(0xF0F0F0)
#define NEUTRAL_96 lv_color_hex(0xF3F3F3)
#define NEUTRAL_98 lv_color_hex(0xFAFAFA)
#define NEUTRAL_100 lv_color_hex(0xFFFFFF)
#define TINT_NEUTRAL (10)
#define TINT_NEUTRAL_VARIANT (20)
#define CORNER_NONE 0
#define CORNER_EXTRA_SMALL (LV_DPX_CALC(theme->disp_dpi, 4))
#define CORNER_SMALL (LV_DPX_CALC(theme->disp_dpi, 8))
#define CORNER_MEDIUM (LV_DPX_CALC(theme->disp_dpi, 12))
#define CORNER_LARGE (LV_DPX_CALC(theme->disp_dpi, 16))
#define CORNER_EXTRA_LARGE (LV_DPX_CALC(theme->disp_dpi, 28))
#define CORNER_FULL LV_RADIUS_CIRCLE
#define CORNER_COMPACT 3
#define SPACE_1 (LV_DPX_CALC(theme->disp_dpi, 4))
#define SPACE_2 (LV_DPX_CALC(theme->disp_dpi, 8))
#define SPACE_3 (LV_DPX_CALC(theme->disp_dpi, 12))
#define SPACE_4 (LV_DPX_CALC(theme->disp_dpi, 16))
#define SPACE_6 (LV_DPX_CALC(theme->disp_dpi, 24))
#define OPACITY_STATE_HOVER (20)
#define OPACITY_STATE_FOCUS (LV_OPA_10)
#define OPACITY_STATE_PRESSED (LV_OPA_10)
#define OPACITY_DISABLED_CONTENT (97)
#define OPACITY_DISABLED_CONTAINER (31)
#define OPACITY_SCRIM (82)
#define DURATION_SHORT 100
#define DURATION_MEDIUM 250
#define DURATION_LONG 500
#define COLOR_PRIMARY (theme->config.is_dark ? lv_color_mix(theme->config.color_primary, lv_color_white(), 140) : theme->config.color_primary)
#define COLOR_ON_PRIMARY (theme->config.is_dark ? lv_color_mix(theme->config.color_primary, lv_color_black(), LV_OPA_50) : lv_color_white())
#define COLOR_PRIMARY_CONTAINER (theme->config.is_dark ? lv_color_mix(theme->config.color_primary, lv_color_black(), LV_OPA_70) : lv_color_mix(theme->config.color_primary, lv_color_white(), 64))
#define COLOR_ON_PRIMARY_CONTAINER (theme->config.is_dark ? lv_color_mix(theme->config.color_primary, lv_color_white(), LV_OPA_20) : lv_color_mix(theme->config.color_primary, lv_color_black(), LV_OPA_60))
#define COLOR_SECONDARY (theme->config.is_dark ? lv_color_mix(theme->config.color_secondary, lv_color_white(), 140) : theme->config.color_secondary)
#define COLOR_ON_SECONDARY (theme->config.is_dark ? lv_color_mix(theme->config.color_secondary, lv_color_black(), LV_OPA_50) : lv_color_white())
#define COLOR_SECONDARY_CONTAINER (theme->config.is_dark ? lv_color_mix(theme->config.color_secondary, lv_color_black(), LV_OPA_70) : lv_color_mix(theme->config.color_secondary, lv_color_white(), 64))
#define COLOR_ON_SECONDARY_CONTAINER (theme->config.is_dark ? lv_color_mix(theme->config.color_secondary, lv_color_white(), LV_OPA_20) : lv_color_mix(theme->config.color_secondary, lv_color_black(), LV_OPA_60))
#define COLOR_ERROR (theme->config.is_dark ? lv_color_mix(theme->config.color_error, lv_color_white(), 140) : theme->config.color_error)
#define COLOR_ON_ERROR (theme->config.is_dark ? lv_color_mix(theme->config.color_error, lv_color_black(), LV_OPA_50) : lv_color_white())
#define COLOR_SURFACE (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_6 : NEUTRAL_98, TINT_NEUTRAL))
#define COLOR_ON_SURFACE (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_90 : NEUTRAL_10, TINT_NEUTRAL))
#define COLOR_ON_SURFACE_VARIANT (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_80 : NEUTRAL_30, TINT_NEUTRAL_VARIANT))
#define COLOR_SURFACE_CONTAINER_LOWEST (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_4 : NEUTRAL_100, TINT_NEUTRAL))
#define COLOR_SURFACE_CONTAINER_LOW (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_10 : NEUTRAL_96, TINT_NEUTRAL))
#define COLOR_SURFACE_CONTAINER (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_12 : NEUTRAL_94, TINT_NEUTRAL))
#define COLOR_SURFACE_CONTAINER_HIGH (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_17 : NEUTRAL_92, TINT_NEUTRAL))
#define COLOR_SURFACE_CONTAINER_HIGHEST (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_22 : NEUTRAL_90, TINT_NEUTRAL))
#define COLOR_OUTLINE (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_60 : NEUTRAL_50, TINT_NEUTRAL_VARIANT))
#define COLOR_OUTLINE_VARIANT (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_30 : NEUTRAL_80, TINT_NEUTRAL_VARIANT))
#define COLOR_INVERSE_SURFACE (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_90 : NEUTRAL_20, TINT_NEUTRAL))
#define COLOR_INVERSE_ON_SURFACE (lv_color_mix(theme->config.color_primary, theme->config.is_dark ? NEUTRAL_20 : NEUTRAL_95, TINT_NEUTRAL))
#define COLOR_SCRIM lv_color_black()
#define SHAPE_CONTROL (theme->config.is_compact ? CORNER_COMPACT : CORNER_FULL)
#define SHAPE_CONTAINER (theme->config.is_compact ? CORNER_COMPACT : CORNER_MEDIUM)
#define SHAPE_FIELD (theme->config.is_compact ? CORNER_COMPACT : CORNER_EXTRA_SMALL)
#define SHAPE_KEY (theme->config.is_compact ? CORNER_COMPACT : CORNER_SMALL)
#define SHAPE_DIALOG (theme->config.is_compact ? CORNER_COMPACT : CORNER_EXTRA_LARGE)
#define SHAPE_MENU (theme->config.is_compact ? CORNER_COMPACT : CORNER_EXTRA_SMALL)
#define DENSITY_CONTAINER_PAD (theme->config.is_compact ? 2 : SPACE_4)
#define DENSITY_CONTAINER_GAP (theme->config.is_compact ? 2 : SPACE_3)
#define DENSITY_CONTAINER_BORDER (theme->config.is_compact ? 1 : 0)
#define DENSITY_CONTROL_PAD_HOR (theme->config.is_compact ? 3 : SPACE_6)
#define DENSITY_CONTROL_PAD_VER (theme->config.is_compact ? 3 : LV_DPX_CALC(theme->disp_dpi, 10))
#define DENSITY_CONTROL_GAP (theme->config.is_compact ? 2 : SPACE_2)
#define DENSITY_FIELD_PAD_HOR (theme->config.is_compact ? 2 : SPACE_4)
#define DENSITY_FIELD_PAD_VER (theme->config.is_compact ? 2 : SPACE_2)
#define DENSITY_LIST_PAD (theme->config.is_compact ? 2 : SPACE_2)
#define DENSITY_LIST_ITEM_PAD_HOR (theme->config.is_compact ? 2 : SPACE_4)
#define DENSITY_LIST_ITEM_PAD_VER (theme->config.is_compact ? 2 : SPACE_3)
#define DENSITY_DIALOG_PAD (theme->config.is_compact ? 2 : SPACE_6)
#define DENSITY_KEY_GAP (theme->config.is_compact ? 2 : SPACE_1)
#define DENSITY_BORDER (LV_DPX_CALC(theme->disp_dpi, 1))
#define FOCUS_COLOR COLOR_SECONDARY
#define FOCUS_WIDTH (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 3))
#define FOCUS_OFFSET (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 2))
#define FOCUS_INSET_WIDTH (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 2))
#define EDIT_COLOR COLOR_PRIMARY
#define STATE_PRESSED_ON_PRIMARY (lv_color_mix(COLOR_ON_PRIMARY, COLOR_PRIMARY, OPACITY_STATE_PRESSED))
#define STATE_PRESSED_ON_SECONDARY (lv_color_mix(COLOR_ON_SECONDARY, COLOR_SECONDARY, OPACITY_STATE_PRESSED))
#define STATE_LAYER_COLOR COLOR_ON_SURFACE
#define MOTION_DURATION_SHORT (theme->config.animations_enabled ? DURATION_SHORT : 0)
#define MOTION_DURATION_MEDIUM (theme->config.animations_enabled ? DURATION_MEDIUM : 0)
#define MOTION_DURATION_LONG (theme->config.animations_enabled ? DURATION_LONG : 0)
#define SCREEN_COLOR COLOR_SURFACE
#define SCREEN_TEXT_COLOR COLOR_ON_SURFACE
#define SCREEN_GAP DENSITY_CONTAINER_GAP
#define CONTAINER_COLOR COLOR_SURFACE_CONTAINER_LOW
#define CONTAINER_TEXT_COLOR COLOR_ON_SURFACE
#define CONTAINER_BORDER_COLOR COLOR_OUTLINE_VARIANT
#define CONTAINER_BORDER_WIDTH DENSITY_CONTAINER_BORDER
#define CONTAINER_SHAPE SHAPE_CONTAINER
#define CONTAINER_PAD DENSITY_CONTAINER_PAD
#define CONTAINER_GAP DENSITY_CONTAINER_GAP
#define CARD_COLOR COLOR_SURFACE_CONTAINER_HIGH
#define CARD_TEXT_COLOR COLOR_ON_SURFACE
#define CARD_BORDER_COLOR COLOR_OUTLINE_VARIANT
#define CARD_BORDER_WIDTH DENSITY_CONTAINER_BORDER
#define CARD_SHAPE SHAPE_CONTAINER
#define CARD_PAD DENSITY_CONTAINER_PAD
#define CARD_GAP DENSITY_CONTAINER_GAP
#define SCROLLBAR_COLOR COLOR_OUTLINE
#define SCROLLBAR_OPACITY (LV_OPA_40)
#define SCROLLBAR_SCROLLED_OPACITY (LV_OPA_70)
#define SCROLLBAR_WIDTH (theme->config.is_compact ? 2 : SPACE_1)
#define SCROLLBAR_PAD (theme->config.is_compact ? 1 : SPACE_1)
#define BUTTON_CONTAINER_COLOR COLOR_PRIMARY
#define BUTTON_LABEL_COLOR COLOR_ON_PRIMARY
#define BUTTON_PRESSED_CONTAINER_COLOR STATE_PRESSED_ON_PRIMARY
#define BUTTON_CHECKED_CONTAINER_COLOR COLOR_SECONDARY
#define BUTTON_CHECKED_LABEL_COLOR COLOR_ON_SECONDARY
#define BUTTON_CHECKED_PRESSED_CONTAINER_COLOR STATE_PRESSED_ON_SECONDARY
#define BUTTON_DISABLED_CONTAINER_COLOR COLOR_ON_SURFACE
#define BUTTON_DISABLED_CONTAINER_OPACITY OPACITY_DISABLED_CONTAINER
#define BUTTON_DISABLED_LABEL_COLOR COLOR_ON_SURFACE
#define BUTTON_DISABLED_LABEL_OPACITY OPACITY_DISABLED_CONTENT
#define BUTTON_SHAPE SHAPE_CONTROL
#define BUTTON_PAD_HOR DENSITY_CONTROL_PAD_HOR
#define BUTTON_PAD_VER DENSITY_CONTROL_PAD_VER
#define BUTTON_GAP DENSITY_CONTROL_GAP
#define TEXT_BUTTON_LABEL_COLOR COLOR_PRIMARY
#define TEXT_BUTTON_PRESSED_CONTAINER_COLOR COLOR_PRIMARY
#define TEXT_BUTTON_PAD_HOR (theme->config.is_compact ? 3 : SPACE_3)
#define ICON_BUTTON_COLOR COLOR_ON_SURFACE_VARIANT
#define ICON_BUTTON_SELECTED_COLOR COLOR_PRIMARY
#define ICON_BUTTON_CONTAINER_SHAPE (theme->config.is_compact ? CORNER_COMPACT : CORNER_LARGE)
#define ICON_BUTTON_FILLED_COLOR COLOR_PRIMARY
#define ICON_BUTTON_FILLED_ICON_COLOR COLOR_ON_PRIMARY
#define ICON_BUTTON_FILLED_PRESSED_COLOR STATE_PRESSED_ON_PRIMARY
#define ICON_BUTTON_TONAL_COLOR COLOR_SECONDARY_CONTAINER
#define ICON_BUTTON_TONAL_ICON_COLOR COLOR_ON_SECONDARY_CONTAINER
#define ICON_BUTTON_TONAL_PRESSED_COLOR (lv_color_mix(COLOR_ON_SECONDARY_CONTAINER, COLOR_SECONDARY_CONTAINER, OPACITY_STATE_PRESSED))
#define APP_BAR_COLOR (lv_color_mix(theme->config.color_primary, NEUTRAL_22, TINT_NEUTRAL))
#define APP_BAR_CONTENT_COLOR lv_color_white()
#define APP_BAR_PRESSED_OPACITY (LV_OPA_20)
#define APP_BAR_PAD_HOR (theme->config.is_compact ? 0 : SPACE_1)
#define APP_BAR_GAP (theme->config.is_compact ? 2 : SPACE_1)
#define APP_BAR_FOCUS_WIDTH FOCUS_INSET_WIDTH
#define FOCUS_RING_COLOR FOCUS_COLOR
#define FOCUS_RING_WIDTH FOCUS_WIDTH
#define FOCUS_RING_OFFSET FOCUS_OFFSET
#define EDIT_RING_COLOR EDIT_COLOR
#define SWITCH_WIDTH (theme->config.is_compact ? 25 : LV_DPX_CALC(theme->disp_dpi, 52))
#define SWITCH_HEIGHT (theme->config.is_compact ? 15 : LV_DPX_CALC(theme->disp_dpi, 32))
#define SWITCH_TRACK_COLOR COLOR_SURFACE_CONTAINER_HIGHEST
#define SWITCH_TRACK_BORDER_COLOR COLOR_OUTLINE
#define SWITCH_TRACK_BORDER_WIDTH (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 2))
#define SWITCH_TRACK_SELECTED_COLOR COLOR_PRIMARY
#define SWITCH_HANDLE_COLOR COLOR_OUTLINE
#define SWITCH_HANDLE_SELECTED_COLOR COLOR_ON_PRIMARY
#define SWITCH_HANDLE_PAD (theme->config.is_compact ? -3 : -LV_DPX_CALC(theme->disp_dpi, 8))
#define SWITCH_HANDLE_SELECTED_PAD (theme->config.is_compact ? -2 : -LV_DPX_CALC(theme->disp_dpi, 4))
#define SWITCH_HANDLE_PRESSED_PAD (theme->config.is_compact ? -1 : -LV_DPX_CALC(theme->disp_dpi, 2))
#define CHECKBOX_GAP (theme->config.is_compact ? 3 : SPACE_3)
#define CHECKBOX_BOX_COLOR COLOR_SURFACE
#define CHECKBOX_BOX_OPACITY LV_OPA_TRANSP
#define CHECKBOX_BOX_BORDER_COLOR COLOR_ON_SURFACE_VARIANT
#define CHECKBOX_BOX_BORDER_WIDTH (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 2))
#define CHECKBOX_BOX_SHAPE (theme->config.is_compact ? 2 : LV_DPX_CALC(theme->disp_dpi, 2))
#define CHECKBOX_BOX_PAD (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 2))
#define CHECKBOX_BOX_SELECTED_COLOR COLOR_PRIMARY
#define CHECKBOX_ICON_COLOR COLOR_ON_PRIMARY
#define SLIDER_TRACK_COLOR COLOR_SECONDARY_CONTAINER
#define SLIDER_ACTIVE_TRACK_COLOR COLOR_PRIMARY
#define SLIDER_HANDLE_COLOR COLOR_PRIMARY
#define SLIDER_TRACK_HEIGHT (LV_DPX_CALC(theme->disp_dpi, 8))
#define SLIDER_HANDLE_PAD ((theme->config.is_compact ? 2 : LV_DPX_CALC(theme->disp_dpi, 6)) + LV_DPX_CALC(theme->disp_dpi, 4))
#define SLIDERBOX_GAP (theme->config.is_compact ? 4 : ((SLIDER_TRACK_HEIGHT / 2) + SLIDER_HANDLE_PAD) + SPACE_2)
#define PROGRESS_TRACK_COLOR COLOR_SECONDARY_CONTAINER
#define PROGRESS_INDICATOR_COLOR COLOR_PRIMARY
#define ARC_TRACK_COLOR COLOR_SECONDARY_CONTAINER
#define ARC_INDICATOR_COLOR COLOR_PRIMARY
#define ARC_WIDTH (theme->config.is_compact ? 3 : SPACE_1)
#define ARC_HANDLE_COLOR COLOR_PRIMARY
#define ARC_HANDLE_PAD (theme->config.is_compact ? 2 : SPACE_1)
#define FIELD_COLOR COLOR_SURFACE
#define FIELD_OPACITY LV_OPA_TRANSP
#define FIELD_TEXT_COLOR COLOR_ON_SURFACE
#define FIELD_BORDER_COLOR COLOR_OUTLINE
#define FIELD_BORDER_WIDTH DENSITY_BORDER
#define FIELD_FOCUSED_BORDER_COLOR COLOR_PRIMARY
#define FIELD_FOCUSED_BORDER_WIDTH (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 2))
#define FIELD_SHAPE SHAPE_FIELD
#define FIELD_PAD_HOR DENSITY_FIELD_PAD_HOR
#define FIELD_PAD_VER DENSITY_FIELD_PAD_VER
#define FIELD_PLACEHOLDER_COLOR COLOR_ON_SURFACE_VARIANT
#define FIELD_CURSOR_COLOR COLOR_PRIMARY
#define FIELD_CURSOR_WIDTH (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 2))
#define FIELD_SELECTION_COLOR COLOR_PRIMARY_CONTAINER
#define FIELD_SELECTION_TEXT_COLOR COLOR_ON_PRIMARY_CONTAINER
#define SPINBOX_CURSOR_COLOR COLOR_PRIMARY
#define SPINBOX_CURSOR_TEXT_COLOR COLOR_ON_PRIMARY
#define MENU_COLOR COLOR_SURFACE_CONTAINER
#define MENU_TEXT_COLOR COLOR_ON_SURFACE
#define MENU_SHAPE SHAPE_MENU
#define MENU_PAD (theme->config.is_compact ? 1 : SPACE_2)
#define MENU_MAX_HEIGHT (LV_DPI_DEF * 2)
#define MENU_ITEM_SELECTED_COLOR COLOR_SECONDARY_CONTAINER
#define MENU_ITEM_SELECTED_TEXT_COLOR COLOR_ON_SECONDARY_CONTAINER
#define MENU_ITEM_LINE_SPACE (theme->config.is_compact ? 4 : SPACE_4)
#define ROLLER_COLOR COLOR_SURFACE_CONTAINER
#define ROLLER_TEXT_COLOR COLOR_ON_SURFACE_VARIANT
#define ROLLER_SELECTED_COLOR COLOR_SECONDARY_CONTAINER
#define ROLLER_SELECTED_TEXT_COLOR COLOR_ON_SECONDARY_CONTAINER
#define ROLLER_LINE_SPACE (theme->config.is_compact ? 4 : SPACE_4)
#define KEYS_COLOR COLOR_SURFACE_CONTAINER
#define KEYS_PAD DENSITY_KEY_GAP
#define KEYS_GAP DENSITY_KEY_GAP
#define KEY_COLOR COLOR_SURFACE_CONTAINER_HIGHEST
#define KEY_TEXT_COLOR COLOR_ON_SURFACE
#define KEY_SHAPE SHAPE_KEY
#define KEY_CHECKED_COLOR COLOR_SECONDARY_CONTAINER
#define KEY_CHECKED_TEXT_COLOR COLOR_ON_SECONDARY_CONTAINER
#define KEY_SELECTED_COLOR COLOR_PRIMARY
#define KEY_SELECTED_TEXT_COLOR COLOR_ON_PRIMARY
#define LIST_COLOR COLOR_SURFACE
#define LIST_PAD DENSITY_LIST_PAD
#define LIST_ITEM_COLOR COLOR_SURFACE
#define LIST_ITEM_OPACITY LV_OPA_TRANSP
#define LIST_ITEM_TEXT_COLOR COLOR_ON_SURFACE
#define LIST_ITEM_PAD_HOR DENSITY_LIST_ITEM_PAD_HOR
#define LIST_ITEM_PAD_VER DENSITY_LIST_ITEM_PAD_VER
#define LIST_ITEM_GAP (theme->config.is_compact ? 3 : SPACE_4)
#define LIST_ITEM_FOCUSED_COLOR COLOR_SECONDARY_CONTAINER
#define LIST_ITEM_FOCUSED_TEXT_COLOR COLOR_ON_SECONDARY_CONTAINER
#define LIST_DIVIDER_COLOR COLOR_OUTLINE_VARIANT
#define LIST_DIVIDER_WIDTH DENSITY_BORDER
#define LIST_SUBHEADER_TEXT_COLOR COLOR_ON_SURFACE_VARIANT
#define TABS_DIVIDER_COLOR COLOR_OUTLINE_VARIANT
#define TAB_LABEL_COLOR COLOR_ON_SURFACE_VARIANT
#define TAB_SELECTED_LABEL_COLOR COLOR_PRIMARY
#define TAB_INDICATOR_COLOR COLOR_PRIMARY
#define TAB_INDICATOR_WIDTH (theme->config.is_compact ? 2 : LV_DPX_CALC(theme->disp_dpi, 3))
#define TAB_PAGE_PAD DENSITY_CONTAINER_PAD
#define DIALOG_COLOR COLOR_SURFACE_CONTAINER_HIGH
#define DIALOG_TEXT_COLOR COLOR_ON_SURFACE_VARIANT
#define DIALOG_TITLE_COLOR COLOR_ON_SURFACE
#define DIALOG_SHAPE SHAPE_DIALOG
#define DIALOG_PAD DENSITY_DIALOG_PAD
#define DIALOG_GAP (theme->config.is_compact ? 2 : SPACE_2)
#define DIALOG_SCRIM_COLOR COLOR_SCRIM
#define DIALOG_SCRIM_OPACITY OPACITY_SCRIM
#define SETTINGS_COLOR COLOR_SURFACE
#define SETTINGS_SECTION_COLOR COLOR_SURFACE_CONTAINER_LOW
#define SETTINGS_SECTION_SHAPE SHAPE_CONTAINER
#define SETTINGS_ITEM_PAD_HOR DENSITY_LIST_ITEM_PAD_HOR
#define SETTINGS_ITEM_PAD_VER DENSITY_LIST_ITEM_PAD_VER
#define SETTINGS_ITEM_GAP DENSITY_CONTAINER_GAP
#define SETTINGS_DIVIDER_COLOR COLOR_OUTLINE_VARIANT
#define SETTINGS_ITEM_SELECTED_COLOR COLOR_SECONDARY_CONTAINER
#define SETTINGS_ITEM_SELECTED_TEXT_COLOR COLOR_ON_SECONDARY_CONTAINER
#define WINDOW_HEADER_COLOR COLOR_SURFACE_CONTAINER
#define WINDOW_HEADER_PAD (theme->config.is_compact ? 2 : SPACE_2)
#define WINDOW_CONTENT_PAD DENSITY_CONTAINER_PAD
#define TABLE_COLOR COLOR_SURFACE
#define TABLE_CELL_TEXT_COLOR COLOR_ON_SURFACE
#define TABLE_CELL_PAD (theme->config.is_compact ? 2 : SPACE_3)
#define TABLE_DIVIDER_COLOR COLOR_OUTLINE_VARIANT
#define CHART_COLOR COLOR_SURFACE_CONTAINER_LOW
#define CHART_GRID_COLOR COLOR_OUTLINE_VARIANT
#define CHART_SERIES_WIDTH (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 2))
#define CHART_POINT_SIZE (theme->config.is_compact ? 3 : LV_DPX_CALC(theme->disp_dpi, 6))
#define CHART_INDICATOR_COLOR COLOR_PRIMARY
#define CALENDAR_COLOR COLOR_SURFACE_CONTAINER_HIGH
#define CALENDAR_SHAPE (theme->config.is_compact ? CORNER_COMPACT : CORNER_LARGE)
#define CALENDAR_PAD (theme->config.is_compact ? 2 : SPACE_2)
#define CALENDAR_DAY_TEXT_COLOR COLOR_ON_SURFACE
#define CALENDAR_HEADER_PAD (theme->config.is_compact ? 2 : SPACE_3)
#define SCALE_COLOR COLOR_ON_SURFACE_VARIANT
#define SCALE_WIDTH DENSITY_BORDER
#define SCALE_TICK_LENGTH (theme->config.is_compact ? 3 : LV_DPX_CALC(theme->disp_dpi, 6))
#define DIVIDER_COLOR COLOR_OUTLINE_VARIANT
#define DIVIDER_WIDTH DENSITY_BORDER
#define LED_GLOW_WIDTH (theme->config.is_compact ? 4 : LV_DPX_CALC(theme->disp_dpi, 15))
#define LED_GLOW_SPREAD (theme->config.is_compact ? 1 : LV_DPX_CALC(theme->disp_dpi, 5))
/**********************
* TYPEDEFS
**********************/
typedef struct {
lv_style_t transition_enter;
lv_style_t transition_exit;
lv_style_t focus_ring;
lv_style_t edit_ring;
lv_style_t focus_ring_inset;
lv_style_t edit_ring_inset;
lv_style_t state_pressed;
lv_style_t disabled;
lv_style_t scrollbar;
lv_style_t scrollbar_scrolled;
#if LV_USE_TABVIEW || LV_USE_TILEVIEW || LV_USE_WIN
lv_style_t page;
#endif
lv_style_t screen;
lv_style_t container;
lv_style_t card;
#if LV_USE_BUTTON
lv_style_t button;
#endif
#if LV_USE_BUTTON
lv_style_t button_pressed;
#endif
#if LV_USE_BUTTON
lv_style_t button_checked;
#endif
#if LV_USE_BUTTON
lv_style_t button_checked_pressed;
#endif
lv_style_t button_disabled;
#if LV_USE_MSGBOX
lv_style_t text_button;
#endif
#if LV_USE_MSGBOX
lv_style_t text_button_pressed;
#endif
lv_style_t icon_button;
lv_style_t icon_button_selected;
lv_style_t icon_button_filled;
lv_style_t icon_button_filled_pressed;
lv_style_t icon_button_tonal;
lv_style_t icon_button_tonal_pressed;
lv_style_t app_bar;
lv_style_t app_bar_actions;
lv_style_t app_bar_button;
lv_style_t app_bar_button_pressed;
lv_style_t app_bar_focus_ring;
#if LV_USE_DROPDOWN
lv_style_t app_bar_field;
#endif
#if LV_USE_SWITCH
lv_style_t switch_track;
#endif
#if LV_USE_SWITCH
lv_style_t switch_track_selected;
#endif
#if LV_USE_SWITCH
lv_style_t switch_indicator_selected;
#endif
#if LV_USE_SWITCH
lv_style_t switch_handle;
#endif
#if LV_USE_SWITCH
lv_style_t switch_handle_selected;
#endif
#if LV_USE_SWITCH
lv_style_t switch_handle_pressed;
#endif
#if LV_USE_CHECKBOX
lv_style_t checkbox;
#endif
#if LV_USE_CHECKBOX
lv_style_t checkbox_box;
#endif
#if LV_USE_CHECKBOX
lv_style_t checkbox_box_selected;
#endif
lv_style_t sliderbox;
#if LV_USE_SLIDER
lv_style_t slider_track_size;
#endif
#if LV_USE_SLIDER
lv_style_t slider_knob_room;
#endif
#if LV_USE_SLIDER
lv_style_t slider_track;
#endif
#if LV_USE_SLIDER
lv_style_t slider_active_track;
#endif
#if LV_USE_SLIDER
lv_style_t slider_handle;
#endif
#if LV_USE_BAR
lv_style_t progress_track;
#endif
#if LV_USE_BAR
lv_style_t progress_indicator;
#endif
#if LV_USE_ARC || LV_USE_SPINNER
lv_style_t arc_track;
#endif
#if LV_USE_ARC || LV_USE_SPINNER
lv_style_t arc_indicator;
#endif
#if LV_USE_ARC
lv_style_t arc_handle;
#endif
#if LV_USE_DROPDOWN || LV_USE_SPINBOX || LV_USE_TEXTAREA
lv_style_t field;
#endif
#if LV_USE_SPINBOX || LV_USE_TEXTAREA
lv_style_t field_focused;
#endif
#if LV_USE_TEXTAREA
lv_style_t field_placeholder;
#endif
#if LV_USE_TEXTAREA
lv_style_t field_cursor;
#endif
#if LV_USE_LABEL && LV_USE_TEXTAREA
lv_style_t field_selection;
#endif
#if LV_USE_SPINBOX
lv_style_t spinbox_cursor;
#endif
#if LV_USE_DROPDOWN
lv_style_t menu;
#endif
#if LV_USE_DROPDOWN
lv_style_t menu_item;
#endif
#if LV_USE_DROPDOWN
lv_style_t menu_item_selected;
#endif
#if LV_USE_ROLLER
lv_style_t roller;
#endif
#if LV_USE_ROLLER
lv_style_t roller_selected;
#endif
#if LV_USE_BUTTONMATRIX || LV_USE_KEYBOARD
lv_style_t keys;
#endif
#if LV_USE_BUTTONMATRIX || LV_USE_KEYBOARD
lv_style_t key;
#endif
#if LV_USE_BUTTONMATRIX || LV_USE_KEYBOARD
lv_style_t key_pressed;
#endif
#if LV_USE_KEYBOARD
lv_style_t key_checked;
#endif
#if LV_USE_BUTTONMATRIX || LV_USE_KEYBOARD
lv_style_t key_selected;
#endif
#if LV_USE_LIST
lv_style_t list;
#endif
#if LV_USE_LIST
lv_style_t list_item;
#endif
#if LV_USE_LIST || LV_USE_TABLE
lv_style_t list_item_focused;
#endif
#if LV_USE_LIST
lv_style_t list_subheader;
#endif
#if LV_USE_TABVIEW
lv_style_t tabs;
#endif
#if LV_USE_BUTTON && LV_USE_TABVIEW
lv_style_t tab;
#endif
#if LV_USE_BUTTON && LV_USE_TABVIEW
lv_style_t tab_selected;
#endif
#if LV_USE_TABVIEW
lv_style_t tab_page;
#endif
#if LV_USE_MSGBOX
lv_style_t dialog;
#endif
#if LV_USE_MSGBOX
lv_style_t dialog_header;
#endif
#if LV_USE_LABEL && LV_USE_MSGBOX
lv_style_t dialog_title;
#endif
#if LV_USE_MSGBOX
lv_style_t dialog_content;
#endif
#if LV_USE_MSGBOX
lv_style_t dialog_actions;
#endif
#if LV_USE_MSGBOX
lv_style_t dialog_scrim;
#endif
#if LV_USE_MENU
lv_style_t settings;
#endif
#if LV_USE_MENU
lv_style_t settings_sidebar;
#endif
#if LV_USE_MENU
lv_style_t settings_content;
#endif
#if LV_USE_MENU
lv_style_t settings_page;
#endif
#if LV_USE_MENU
lv_style_t settings_header;
#endif
#if LV_USE_MENU
lv_style_t settings_section;
#endif
#if LV_USE_MENU
lv_style_t settings_item;
#endif
#if LV_USE_MENU
lv_style_t settings_item_selected;
#endif
#if LV_USE_MENU
lv_style_t settings_separator;
#endif
#if LV_USE_WIN
lv_style_t window_header;
#endif
#if LV_USE_LABEL && LV_USE_WIN
lv_style_t window_title;
#endif
#if LV_USE_WIN
lv_style_t window_content;
#endif
#if LV_USE_TABLE
lv_style_t table;
#endif
#if LV_USE_TABLE
lv_style_t table_cell;
#endif
#if LV_USE_CHART
lv_style_t chart;
#endif
#if LV_USE_CHART
lv_style_t chart_series;
#endif
#if LV_USE_CHART
lv_style_t chart_indicator;
#endif
#if LV_USE_CALENDAR
lv_style_t calendar;
#endif
#if LV_USE_BUTTONMATRIX && LV_USE_CALENDAR
lv_style_t calendar_days;
#endif
#if LV_USE_BUTTONMATRIX && LV_USE_CALENDAR
lv_style_t calendar_day;
#endif
#if (LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_ARROW) || (LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_DROPDOWN)
lv_style_t calendar_header;
#endif
#if LV_USE_SCALE
lv_style_t scale;
#endif
#if LV_USE_LINE
lv_style_t divider;
#endif
#if LV_USE_LED
lv_style_t led;
#endif
} my_theme_styles_t;
typedef enum {
DISP_SMALL = 3,
DISP_MEDIUM = 2,
DISP_LARGE = 1,
} disp_size_t;
typedef struct {
lv_theme_t base;
disp_size_t disp_size;
int32_t disp_dpi;
lv_theme_material_config_t config;
bool inited;
my_theme_styles_t styles;
lv_style_transition_dsc_t trans_state_enter;
lv_style_transition_dsc_t trans_state_exit;
} my_theme_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void style_init_reset(lv_style_t * style);
static void theme_apply(lv_theme_t * th, lv_obj_t * obj);
static void resolution_change_event_cb(lv_event_t * e);
/**********************
* STATIC VARIABLES
**********************/
static my_theme_t * theme_def = NULL;
/**********************
* STATIC FUNCTIONS
**********************/
static inline lv_obj_t * lss_ancestor(lv_obj_t * obj, uint32_t depth)
{
while(obj != NULL && depth > 0) {
obj = lv_obj_get_parent(obj);
depth--;
}
return obj;
}
static inline bool lss_is_child(lv_obj_t * parent, int32_t index, lv_obj_t * child)
{
return parent != NULL && lv_obj_get_child(parent, index) == child;
}
static bool config_equals(const lv_theme_material_config_t * a, const lv_theme_material_config_t * b)
{
return a->is_dark == b->is_dark &&
a->is_compact == b->is_compact &&
a->animations_enabled == b->animations_enabled &&
lv_color_eq(a->color_primary, b->color_primary) &&
lv_color_eq(a->color_secondary, b->color_secondary) &&
lv_color_eq(a->color_error, b->color_error) &&
a->font_small == b->font_small &&
a->font_normal == b->font_normal &&
a->font_large == b->font_large;
}
static void style_init(my_theme_t * theme)
{
static const lv_style_prop_t trans_state_enter_props[] = {
LV_STYLE_BG_COLOR, LV_STYLE_BG_OPA, LV_STYLE_BORDER_COLOR, LV_STYLE_TEXT_COLOR, LV_STYLE_OUTLINE_WIDTH, LV_STYLE_OUTLINE_OPA,
0
};
lv_style_transition_dsc_init(&theme->trans_state_enter, trans_state_enter_props, lv_anim_path_ease_out, MOTION_DURATION_SHORT, 0, NULL);
static const lv_style_prop_t trans_state_exit_props[] = {
LV_STYLE_BG_COLOR, LV_STYLE_BG_OPA, LV_STYLE_BORDER_COLOR, LV_STYLE_TEXT_COLOR, LV_STYLE_OUTLINE_WIDTH, LV_STYLE_OUTLINE_OPA,
0
};
lv_style_transition_dsc_init(&theme->trans_state_exit, trans_state_exit_props, lv_anim_path_ease_out, MOTION_DURATION_SHORT, 70, NULL);
style_init_reset(&theme->styles.transition_enter);
if(theme->config.animations_enabled) {
lv_style_set_transition(&theme->styles.transition_enter, &theme->trans_state_enter);
}
style_init_reset(&theme->styles.transition_exit);
if(theme->config.animations_enabled) {
lv_style_set_transition(&theme->styles.transition_exit, &theme->trans_state_exit);
}
style_init_reset(&theme->styles.focus_ring);
lv_style_set_outline_color(&theme->styles.focus_ring, FOCUS_RING_COLOR);
lv_style_set_outline_width(&theme->styles.focus_ring, FOCUS_RING_WIDTH);
lv_style_set_outline_pad(&theme->styles.focus_ring, FOCUS_RING_OFFSET);
lv_style_set_outline_opa(&theme->styles.focus_ring, LV_OPA_COVER);
style_init_reset(&theme->styles.edit_ring);
lv_style_set_outline_color(&theme->styles.edit_ring, EDIT_RING_COLOR);
lv_style_set_outline_width(&theme->styles.edit_ring, FOCUS_RING_WIDTH);
lv_style_set_outline_pad(&theme->styles.edit_ring, FOCUS_RING_OFFSET);
lv_style_set_outline_opa(&theme->styles.edit_ring, LV_OPA_COVER);
style_init_reset(&theme->styles.focus_ring_inset);
lv_style_set_outline_color(&theme->styles.focus_ring_inset, FOCUS_RING_COLOR);
lv_style_set_outline_width(&theme->styles.focus_ring_inset, FOCUS_INSET_WIDTH);
lv_style_set_outline_pad(&theme->styles.focus_ring_inset, -FOCUS_INSET_WIDTH);
lv_style_set_outline_opa(&theme->styles.focus_ring_inset, LV_OPA_COVER);
style_init_reset(&theme->styles.edit_ring_inset);
lv_style_set_outline_color(&theme->styles.edit_ring_inset, EDIT_RING_COLOR);
lv_style_set_outline_width(&theme->styles.edit_ring_inset, FOCUS_INSET_WIDTH);
lv_style_set_outline_pad(&theme->styles.edit_ring_inset, -FOCUS_INSET_WIDTH);
lv_style_set_outline_opa(&theme->styles.edit_ring_inset, LV_OPA_COVER);
style_init_reset(&theme->styles.state_pressed);
lv_style_set_bg_color(&theme->styles.state_pressed, STATE_LAYER_COLOR);
lv_style_set_bg_opa(&theme->styles.state_pressed, OPACITY_STATE_PRESSED);
style_init_reset(&theme->styles.disabled);
lv_style_set_opa(&theme->styles.disabled, OPACITY_DISABLED_CONTENT);
style_init_reset(&theme->styles.scrollbar);
lv_style_set_bg_color(&theme->styles.scrollbar, SCROLLBAR_COLOR);
lv_style_set_bg_opa(&theme->styles.scrollbar, SCROLLBAR_OPACITY);
lv_style_set_radius(&theme->styles.scrollbar, LV_RADIUS_CIRCLE);
lv_style_set_width(&theme->styles.scrollbar, SCROLLBAR_WIDTH);
lv_style_set_pad_all(&theme->styles.scrollbar, SCROLLBAR_PAD);
style_init_reset(&theme->styles.scrollbar_scrolled);
lv_style_set_bg_opa(&theme->styles.scrollbar_scrolled, SCROLLBAR_SCROLLED_OPACITY);
#if LV_USE_TABVIEW || LV_USE_TILEVIEW || LV_USE_WIN
style_init_reset(&theme->styles.page);
lv_style_set_bg_opa(&theme->styles.page, LV_OPA_TRANSP);
lv_style_set_border_width(&theme->styles.page, 0);
lv_style_set_radius(&theme->styles.page, 0);
lv_style_set_pad_all(&theme->styles.page, 0);
lv_style_set_pad_gap(&theme->styles.page, 0);
#endif
style_init_reset(&theme->styles.screen);
lv_style_set_bg_color(&theme->styles.screen, SCREEN_COLOR);
lv_style_set_bg_opa(&theme->styles.screen, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.screen, SCREEN_TEXT_COLOR);
lv_style_set_text_font(&theme->styles.screen, theme->config.font_normal);
lv_style_set_pad_row(&theme->styles.screen, SCREEN_GAP);
lv_style_set_pad_column(&theme->styles.screen, SCREEN_GAP);
lv_style_set_rotary_sensitivity(&theme->styles.screen, (theme->disp_dpi / 4) * 256);
style_init_reset(&theme->styles.container);
lv_style_set_bg_color(&theme->styles.container, CONTAINER_COLOR);
lv_style_set_bg_opa(&theme->styles.container, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.container, CONTAINER_TEXT_COLOR);
lv_style_set_border_color(&theme->styles.container, CONTAINER_BORDER_COLOR);
lv_style_set_border_width(&theme->styles.container, CONTAINER_BORDER_WIDTH);
lv_style_set_border_post(&theme->styles.container, true);
lv_style_set_radius(&theme->styles.container, CONTAINER_SHAPE);
lv_style_set_pad_all(&theme->styles.container, CONTAINER_PAD);
lv_style_set_pad_gap(&theme->styles.container, CONTAINER_GAP);
lv_style_set_line_color(&theme->styles.container, DIVIDER_COLOR);
lv_style_set_line_width(&theme->styles.container, DIVIDER_WIDTH);
style_init_reset(&theme->styles.card);
lv_style_set_bg_color(&theme->styles.card, CARD_COLOR);
lv_style_set_bg_opa(&theme->styles.card, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.card, CARD_TEXT_COLOR);
lv_style_set_border_color(&theme->styles.card, CARD_BORDER_COLOR);
lv_style_set_border_width(&theme->styles.card, CARD_BORDER_WIDTH);
lv_style_set_radius(&theme->styles.card, CARD_SHAPE);
lv_style_set_pad_all(&theme->styles.card, CARD_PAD);
lv_style_set_pad_gap(&theme->styles.card, CARD_GAP);
#if LV_USE_BUTTON
style_init_reset(&theme->styles.button);
lv_style_set_bg_color(&theme->styles.button, BUTTON_CONTAINER_COLOR);
lv_style_set_bg_opa(&theme->styles.button, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.button, BUTTON_LABEL_COLOR);
lv_style_set_radius(&theme->styles.button, BUTTON_SHAPE);
lv_style_set_pad_hor(&theme->styles.button, BUTTON_PAD_HOR);
lv_style_set_pad_ver(&theme->styles.button, BUTTON_PAD_VER);
lv_style_set_pad_gap(&theme->styles.button, BUTTON_GAP);
#endif
#if LV_USE_BUTTON
style_init_reset(&theme->styles.button_pressed);
lv_style_set_bg_color(&theme->styles.button_pressed, BUTTON_PRESSED_CONTAINER_COLOR);
#endif
#if LV_USE_BUTTON
style_init_reset(&theme->styles.button_checked);
lv_style_set_bg_color(&theme->styles.button_checked, BUTTON_CHECKED_CONTAINER_COLOR);
lv_style_set_text_color(&theme->styles.button_checked, BUTTON_CHECKED_LABEL_COLOR);
#endif
#if LV_USE_BUTTON
style_init_reset(&theme->styles.button_checked_pressed);
lv_style_set_bg_color(&theme->styles.button_checked_pressed, BUTTON_CHECKED_PRESSED_CONTAINER_COLOR);
#endif
style_init_reset(&theme->styles.button_disabled);
lv_style_set_bg_color(&theme->styles.button_disabled, BUTTON_DISABLED_CONTAINER_COLOR);
lv_style_set_bg_opa(&theme->styles.button_disabled, BUTTON_DISABLED_CONTAINER_OPACITY);
lv_style_set_text_color(&theme->styles.button_disabled, BUTTON_DISABLED_LABEL_COLOR);
lv_style_set_text_opa(&theme->styles.button_disabled, BUTTON_DISABLED_LABEL_OPACITY);
#if LV_USE_MSGBOX
style_init_reset(&theme->styles.text_button);
lv_style_set_bg_opa(&theme->styles.text_button, LV_OPA_TRANSP);
lv_style_set_text_color(&theme->styles.text_button, TEXT_BUTTON_LABEL_COLOR);
lv_style_set_radius(&theme->styles.text_button, BUTTON_SHAPE);
lv_style_set_pad_hor(&theme->styles.text_button, TEXT_BUTTON_PAD_HOR);
lv_style_set_pad_ver(&theme->styles.text_button, BUTTON_PAD_VER);
lv_style_set_pad_gap(&theme->styles.text_button, BUTTON_GAP);
#endif
#if LV_USE_MSGBOX
style_init_reset(&theme->styles.text_button_pressed);
lv_style_set_bg_color(&theme->styles.text_button_pressed, TEXT_BUTTON_PRESSED_CONTAINER_COLOR);
lv_style_set_bg_opa(&theme->styles.text_button_pressed, OPACITY_STATE_PRESSED);
#endif
style_init_reset(&theme->styles.icon_button);
lv_style_set_bg_opa(&theme->styles.icon_button, LV_OPA_TRANSP);
lv_style_set_text_color(&theme->styles.icon_button, ICON_BUTTON_COLOR);
lv_style_set_radius(&theme->styles.icon_button, BUTTON_SHAPE);
lv_style_set_pad_all(&theme->styles.icon_button, BUTTON_PAD_VER);
style_init_reset(&theme->styles.icon_button_selected);
lv_style_set_text_color(&theme->styles.icon_button_selected, ICON_BUTTON_SELECTED_COLOR);
style_init_reset(&theme->styles.icon_button_filled);
lv_style_set_bg_color(&theme->styles.icon_button_filled, ICON_BUTTON_FILLED_COLOR);
lv_style_set_bg_opa(&theme->styles.icon_button_filled, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.icon_button_filled, ICON_BUTTON_FILLED_ICON_COLOR);
lv_style_set_radius(&theme->styles.icon_button_filled, ICON_BUTTON_CONTAINER_SHAPE);
lv_style_set_pad_all(&theme->styles.icon_button_filled, BUTTON_PAD_VER);
style_init_reset(&theme->styles.icon_button_filled_pressed);
lv_style_set_bg_color(&theme->styles.icon_button_filled_pressed, ICON_BUTTON_FILLED_PRESSED_COLOR);
style_init_reset(&theme->styles.icon_button_tonal);
lv_style_set_bg_color(&theme->styles.icon_button_tonal, ICON_BUTTON_TONAL_COLOR);
lv_style_set_bg_opa(&theme->styles.icon_button_tonal, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.icon_button_tonal, ICON_BUTTON_TONAL_ICON_COLOR);
lv_style_set_radius(&theme->styles.icon_button_tonal, ICON_BUTTON_CONTAINER_SHAPE);
lv_style_set_pad_all(&theme->styles.icon_button_tonal, BUTTON_PAD_VER);
style_init_reset(&theme->styles.icon_button_tonal_pressed);
lv_style_set_bg_color(&theme->styles.icon_button_tonal_pressed, ICON_BUTTON_TONAL_PRESSED_COLOR);
style_init_reset(&theme->styles.app_bar);
lv_style_set_bg_color(&theme->styles.app_bar, APP_BAR_COLOR);
lv_style_set_bg_opa(&theme->styles.app_bar, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.app_bar, APP_BAR_CONTENT_COLOR);
lv_style_set_radius(&theme->styles.app_bar, 0);
lv_style_set_border_width(&theme->styles.app_bar, 0);
lv_style_set_pad_hor(&theme->styles.app_bar, APP_BAR_PAD_HOR);
lv_style_set_pad_ver(&theme->styles.app_bar, 0);
lv_style_set_pad_gap(&theme->styles.app_bar, APP_BAR_GAP);
style_init_reset(&theme->styles.app_bar_actions);
lv_style_set_bg_opa(&theme->styles.app_bar_actions, LV_OPA_TRANSP);
lv_style_set_border_width(&theme->styles.app_bar_actions, 0);
lv_style_set_radius(&theme->styles.app_bar_actions, 0);
lv_style_set_pad_all(&theme->styles.app_bar_actions, 0);
lv_style_set_pad_gap(&theme->styles.app_bar_actions, APP_BAR_GAP);
style_init_reset(&theme->styles.app_bar_button);
lv_style_set_pad_all(&theme->styles.app_bar_button, 0);
lv_style_set_text_color(&theme->styles.app_bar_button, APP_BAR_CONTENT_COLOR);
style_init_reset(&theme->styles.app_bar_button_pressed);
lv_style_set_bg_color(&theme->styles.app_bar_button_pressed, APP_BAR_CONTENT_COLOR);
lv_style_set_bg_opa(&theme->styles.app_bar_button_pressed, APP_BAR_PRESSED_OPACITY);
style_init_reset(&theme->styles.app_bar_focus_ring);
lv_style_set_outline_color(&theme->styles.app_bar_focus_ring, APP_BAR_CONTENT_COLOR);
lv_style_set_outline_width(&theme->styles.app_bar_focus_ring, APP_BAR_FOCUS_WIDTH);
lv_style_set_outline_pad(&theme->styles.app_bar_focus_ring, -APP_BAR_FOCUS_WIDTH);
lv_style_set_outline_opa(&theme->styles.app_bar_focus_ring, LV_OPA_COVER);
#if LV_USE_DROPDOWN
style_init_reset(&theme->styles.app_bar_field);
lv_style_set_text_color(&theme->styles.app_bar_field, APP_BAR_CONTENT_COLOR);
lv_style_set_border_color(&theme->styles.app_bar_field, APP_BAR_CONTENT_COLOR);
#endif
#if LV_USE_SWITCH
style_init_reset(&theme->styles.switch_track);
lv_style_set_width(&theme->styles.switch_track, SWITCH_WIDTH);
lv_style_set_height(&theme->styles.switch_track, SWITCH_HEIGHT);
lv_style_set_bg_color(&theme->styles.switch_track, SWITCH_TRACK_COLOR);
lv_style_set_bg_opa(&theme->styles.switch_track, LV_OPA_COVER);
lv_style_set_border_color(&theme->styles.switch_track, SWITCH_TRACK_BORDER_COLOR);
lv_style_set_border_width(&theme->styles.switch_track, SWITCH_TRACK_BORDER_WIDTH);
lv_style_set_radius(&theme->styles.switch_track, LV_RADIUS_CIRCLE);
lv_style_set_anim_duration(&theme->styles.switch_track, MOTION_DURATION_SHORT);
#endif
#if LV_USE_SWITCH
style_init_reset(&theme->styles.switch_track_selected);
lv_style_set_border_color(&theme->styles.switch_track_selected, SWITCH_TRACK_SELECTED_COLOR);
#endif
#if LV_USE_SWITCH
style_init_reset(&theme->styles.switch_indicator_selected);
lv_style_set_bg_color(&theme->styles.switch_indicator_selected, SWITCH_TRACK_SELECTED_COLOR);
lv_style_set_bg_opa(&theme->styles.switch_indicator_selected, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.switch_indicator_selected, LV_RADIUS_CIRCLE);
#endif
#if LV_USE_SWITCH
style_init_reset(&theme->styles.switch_handle);
lv_style_set_bg_color(&theme->styles.switch_handle, SWITCH_HANDLE_COLOR);
lv_style_set_bg_opa(&theme->styles.switch_handle, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.switch_handle, LV_RADIUS_CIRCLE);
lv_style_set_pad_all(&theme->styles.switch_handle, SWITCH_HANDLE_PAD);
#endif
#if LV_USE_SWITCH
style_init_reset(&theme->styles.switch_handle_selected);
lv_style_set_bg_color(&theme->styles.switch_handle_selected, SWITCH_HANDLE_SELECTED_COLOR);
lv_style_set_pad_all(&theme->styles.switch_handle_selected, SWITCH_HANDLE_SELECTED_PAD);
#endif
#if LV_USE_SWITCH
style_init_reset(&theme->styles.switch_handle_pressed);
lv_style_set_pad_all(&theme->styles.switch_handle_pressed, SWITCH_HANDLE_PRESSED_PAD);
#endif
#if LV_USE_CHECKBOX
style_init_reset(&theme->styles.checkbox);
lv_style_set_pad_gap(&theme->styles.checkbox, CHECKBOX_GAP);
lv_style_set_text_color(&theme->styles.checkbox, COLOR_ON_SURFACE);
#endif
#if LV_USE_CHECKBOX
style_init_reset(&theme->styles.checkbox_box);
lv_style_set_bg_color(&theme->styles.checkbox_box, CHECKBOX_BOX_COLOR);
lv_style_set_bg_opa(&theme->styles.checkbox_box, CHECKBOX_BOX_OPACITY);
lv_style_set_border_color(&theme->styles.checkbox_box, CHECKBOX_BOX_BORDER_COLOR);
lv_style_set_border_width(&theme->styles.checkbox_box, CHECKBOX_BOX_BORDER_WIDTH);
lv_style_set_radius(&theme->styles.checkbox_box, CHECKBOX_BOX_SHAPE);
lv_style_set_pad_all(&theme->styles.checkbox_box, CHECKBOX_BOX_PAD);
lv_style_set_text_font(&theme->styles.checkbox_box, theme->config.font_small);
lv_style_set_text_color(&theme->styles.checkbox_box, CHECKBOX_ICON_COLOR);
#endif
#if LV_USE_CHECKBOX
style_init_reset(&theme->styles.checkbox_box_selected);
lv_style_set_bg_color(&theme->styles.checkbox_box_selected, CHECKBOX_BOX_SELECTED_COLOR);
lv_style_set_bg_opa(&theme->styles.checkbox_box_selected, LV_OPA_COVER);
lv_style_set_border_color(&theme->styles.checkbox_box_selected, CHECKBOX_BOX_SELECTED_COLOR);
lv_style_set_bg_image_src(&theme->styles.checkbox_box_selected, LV_SYMBOL_OK);
#endif
style_init_reset(&theme->styles.sliderbox);
lv_style_set_pad_column(&theme->styles.sliderbox, SLIDERBOX_GAP);
#if LV_USE_SLIDER
style_init_reset(&theme->styles.slider_track_size);
lv_style_set_height(&theme->styles.slider_track_size, SLIDER_TRACK_HEIGHT);
#endif
#if LV_USE_SLIDER
style_init_reset(&theme->styles.slider_knob_room);
lv_style_set_margin_ver(&theme->styles.slider_knob_room, SLIDER_HANDLE_PAD);
#endif
#if LV_USE_SLIDER
style_init_reset(&theme->styles.slider_track);
lv_style_set_bg_color(&theme->styles.slider_track, SLIDER_TRACK_COLOR);
lv_style_set_bg_opa(&theme->styles.slider_track, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.slider_track, LV_RADIUS_CIRCLE);
#endif
#if LV_USE_SLIDER
style_init_reset(&theme->styles.slider_active_track);
lv_style_set_bg_color(&theme->styles.slider_active_track, SLIDER_ACTIVE_TRACK_COLOR);
lv_style_set_bg_opa(&theme->styles.slider_active_track, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.slider_active_track, LV_RADIUS_CIRCLE);
#endif
#if LV_USE_SLIDER
style_init_reset(&theme->styles.slider_handle);
lv_style_set_bg_color(&theme->styles.slider_handle, SLIDER_HANDLE_COLOR);
lv_style_set_bg_opa(&theme->styles.slider_handle, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.slider_handle, LV_RADIUS_CIRCLE);
lv_style_set_pad_all(&theme->styles.slider_handle, SLIDER_HANDLE_PAD);
#endif
#if LV_USE_BAR
style_init_reset(&theme->styles.progress_track);
lv_style_set_bg_color(&theme->styles.progress_track, PROGRESS_TRACK_COLOR);
lv_style_set_bg_opa(&theme->styles.progress_track, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.progress_track, LV_RADIUS_CIRCLE);
#endif
#if LV_USE_BAR
style_init_reset(&theme->styles.progress_indicator);
lv_style_set_bg_color(&theme->styles.progress_indicator, PROGRESS_INDICATOR_COLOR);
lv_style_set_bg_opa(&theme->styles.progress_indicator, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.progress_indicator, LV_RADIUS_CIRCLE);
#endif
#if LV_USE_ARC || LV_USE_SPINNER
style_init_reset(&theme->styles.arc_track);
lv_style_set_arc_color(&theme->styles.arc_track, ARC_TRACK_COLOR);
lv_style_set_arc_width(&theme->styles.arc_track, ARC_WIDTH);
lv_style_set_arc_rounded(&theme->styles.arc_track, true);
#endif
#if LV_USE_ARC || LV_USE_SPINNER
style_init_reset(&theme->styles.arc_indicator);
lv_style_set_arc_color(&theme->styles.arc_indicator, ARC_INDICATOR_COLOR);
lv_style_set_arc_width(&theme->styles.arc_indicator, ARC_WIDTH);
lv_style_set_arc_rounded(&theme->styles.arc_indicator, true);
#endif
#if LV_USE_ARC
style_init_reset(&theme->styles.arc_handle);
lv_style_set_bg_color(&theme->styles.arc_handle, ARC_HANDLE_COLOR);
lv_style_set_bg_opa(&theme->styles.arc_handle, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.arc_handle, LV_RADIUS_CIRCLE);
lv_style_set_pad_all(&theme->styles.arc_handle, ARC_HANDLE_PAD);
#endif
#if LV_USE_DROPDOWN || LV_USE_SPINBOX || LV_USE_TEXTAREA
style_init_reset(&theme->styles.field);
lv_style_set_bg_color(&theme->styles.field, FIELD_COLOR);
lv_style_set_bg_opa(&theme->styles.field, FIELD_OPACITY);
lv_style_set_text_color(&theme->styles.field, FIELD_TEXT_COLOR);
lv_style_set_border_color(&theme->styles.field, FIELD_BORDER_COLOR);
lv_style_set_border_width(&theme->styles.field, FIELD_BORDER_WIDTH);
lv_style_set_radius(&theme->styles.field, FIELD_SHAPE);
lv_style_set_pad_hor(&theme->styles.field, FIELD_PAD_HOR);
lv_style_set_pad_ver(&theme->styles.field, FIELD_PAD_VER);
lv_style_set_pad_gap(&theme->styles.field, FIELD_PAD_VER);
#endif
#if LV_USE_SPINBOX || LV_USE_TEXTAREA
style_init_reset(&theme->styles.field_focused);
lv_style_set_border_color(&theme->styles.field_focused, FIELD_FOCUSED_BORDER_COLOR);
lv_style_set_border_width(&theme->styles.field_focused, FIELD_FOCUSED_BORDER_WIDTH);
#endif
#if LV_USE_TEXTAREA
style_init_reset(&theme->styles.field_placeholder);
lv_style_set_text_color(&theme->styles.field_placeholder, FIELD_PLACEHOLDER_COLOR);
#endif
#if LV_USE_TEXTAREA
style_init_reset(&theme->styles.field_cursor);
lv_style_set_border_color(&theme->styles.field_cursor, FIELD_CURSOR_COLOR);
lv_style_set_border_width(&theme->styles.field_cursor, FIELD_CURSOR_WIDTH);
lv_style_set_border_side(&theme->styles.field_cursor, LV_BORDER_SIDE_LEFT);
lv_style_set_pad_left(&theme->styles.field_cursor, -1);
lv_style_set_anim_duration(&theme->styles.field_cursor, MOTION_DURATION_LONG);
#endif
#if LV_USE_LABEL && LV_USE_TEXTAREA
style_init_reset(&theme->styles.field_selection);
lv_style_set_bg_color(&theme->styles.field_selection, FIELD_SELECTION_COLOR);
lv_style_set_text_color(&theme->styles.field_selection, FIELD_SELECTION_TEXT_COLOR);
#endif
#if LV_USE_SPINBOX
style_init_reset(&theme->styles.spinbox_cursor);
lv_style_set_bg_color(&theme->styles.spinbox_cursor, SPINBOX_CURSOR_COLOR);
lv_style_set_bg_opa(&theme->styles.spinbox_cursor, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.spinbox_cursor, SPINBOX_CURSOR_TEXT_COLOR);
#endif
#if LV_USE_DROPDOWN
style_init_reset(&theme->styles.menu);
lv_style_set_bg_color(&theme->styles.menu, MENU_COLOR);
lv_style_set_bg_opa(&theme->styles.menu, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.menu, MENU_TEXT_COLOR);
lv_style_set_radius(&theme->styles.menu, MENU_SHAPE);
lv_style_set_pad_all(&theme->styles.menu, MENU_PAD);
lv_style_set_text_line_space(&theme->styles.menu, MENU_ITEM_LINE_SPACE);
lv_style_set_max_height(&theme->styles.menu, MENU_MAX_HEIGHT);
lv_style_set_clip_corner(&theme->styles.menu, true);
#endif
#if LV_USE_DROPDOWN
style_init_reset(&theme->styles.menu_item);
lv_style_set_bg_opa(&theme->styles.menu_item, LV_OPA_TRANSP);
#endif
#if LV_USE_DROPDOWN
style_init_reset(&theme->styles.menu_item_selected);
lv_style_set_bg_color(&theme->styles.menu_item_selected, MENU_ITEM_SELECTED_COLOR);
lv_style_set_bg_opa(&theme->styles.menu_item_selected, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.menu_item_selected, MENU_ITEM_SELECTED_TEXT_COLOR);
#endif
#if LV_USE_ROLLER
style_init_reset(&theme->styles.roller);
lv_style_set_bg_color(&theme->styles.roller, ROLLER_COLOR);
lv_style_set_bg_opa(&theme->styles.roller, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.roller, ROLLER_TEXT_COLOR);
lv_style_set_radius(&theme->styles.roller, SHAPE_CONTAINER);
lv_style_set_text_line_space(&theme->styles.roller, ROLLER_LINE_SPACE);
lv_style_set_text_align(&theme->styles.roller, LV_TEXT_ALIGN_CENTER);
lv_style_set_anim_duration(&theme->styles.roller, MOTION_DURATION_MEDIUM);
#endif
#if LV_USE_ROLLER
style_init_reset(&theme->styles.roller_selected);
lv_style_set_bg_color(&theme->styles.roller_selected, ROLLER_SELECTED_COLOR);
lv_style_set_bg_opa(&theme->styles.roller_selected, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.roller_selected, ROLLER_SELECTED_TEXT_COLOR);
#endif
#if LV_USE_BUTTONMATRIX || LV_USE_KEYBOARD
style_init_reset(&theme->styles.keys);
lv_style_set_bg_color(&theme->styles.keys, KEYS_COLOR);
lv_style_set_bg_opa(&theme->styles.keys, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.keys, SHAPE_CONTAINER);
lv_style_set_pad_all(&theme->styles.keys, KEYS_PAD);
lv_style_set_pad_gap(&theme->styles.keys, KEYS_GAP);
#endif
#if LV_USE_BUTTONMATRIX || LV_USE_KEYBOARD
style_init_reset(&theme->styles.key);
lv_style_set_bg_color(&theme->styles.key, KEY_COLOR);
lv_style_set_bg_opa(&theme->styles.key, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.key, KEY_TEXT_COLOR);
lv_style_set_radius(&theme->styles.key, KEY_SHAPE);
#endif
#if LV_USE_BUTTONMATRIX || LV_USE_KEYBOARD
style_init_reset(&theme->styles.key_pressed);
lv_style_set_bg_color(&theme->styles.key_pressed, lv_color_mix(STATE_LAYER_COLOR, KEY_COLOR, OPACITY_STATE_PRESSED));
#endif
#if LV_USE_KEYBOARD
style_init_reset(&theme->styles.key_checked);
lv_style_set_bg_color(&theme->styles.key_checked, KEY_CHECKED_COLOR);
lv_style_set_text_color(&theme->styles.key_checked, KEY_CHECKED_TEXT_COLOR);
#endif
#if LV_USE_BUTTONMATRIX || LV_USE_KEYBOARD
style_init_reset(&theme->styles.key_selected);
lv_style_set_bg_color(&theme->styles.key_selected, KEY_SELECTED_COLOR);
lv_style_set_text_color(&theme->styles.key_selected, KEY_SELECTED_TEXT_COLOR);
#endif
#if LV_USE_LIST
style_init_reset(&theme->styles.list);
lv_style_set_bg_color(&theme->styles.list, LIST_COLOR);
lv_style_set_bg_opa(&theme->styles.list, LV_OPA_COVER);
lv_style_set_pad_hor(&theme->styles.list, 0);
lv_style_set_pad_ver(&theme->styles.list, LIST_PAD);
lv_style_set_pad_gap(&theme->styles.list, 0);
lv_style_set_clip_corner(&theme->styles.list, true);
#endif
#if LV_USE_LIST
style_init_reset(&theme->styles.list_item);
lv_style_set_bg_color(&theme->styles.list_item, LIST_ITEM_COLOR);
lv_style_set_bg_opa(&theme->styles.list_item, LIST_ITEM_OPACITY);
lv_style_set_text_color(&theme->styles.list_item, LIST_ITEM_TEXT_COLOR);
lv_style_set_pad_hor(&theme->styles.list_item, LIST_ITEM_PAD_HOR);
lv_style_set_pad_ver(&theme->styles.list_item, LIST_ITEM_PAD_VER);
lv_style_set_pad_column(&theme->styles.list_item, LIST_ITEM_GAP);
lv_style_set_border_color(&theme->styles.list_item, LIST_DIVIDER_COLOR);
lv_style_set_border_width(&theme->styles.list_item, LIST_DIVIDER_WIDTH);
lv_style_set_border_side(&theme->styles.list_item, LV_BORDER_SIDE_BOTTOM);
#endif
#if LV_USE_LIST || LV_USE_TABLE
style_init_reset(&theme->styles.list_item_focused);
lv_style_set_bg_color(&theme->styles.list_item_focused, LIST_ITEM_FOCUSED_COLOR);
lv_style_set_bg_opa(&theme->styles.list_item_focused, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.list_item_focused, LIST_ITEM_FOCUSED_TEXT_COLOR);
#endif
#if LV_USE_LIST
style_init_reset(&theme->styles.list_subheader);
lv_style_set_text_color(&theme->styles.list_subheader, LIST_SUBHEADER_TEXT_COLOR);
lv_style_set_text_font(&theme->styles.list_subheader, theme->config.font_small);
lv_style_set_pad_hor(&theme->styles.list_subheader, LIST_ITEM_PAD_HOR);
lv_style_set_pad_top(&theme->styles.list_subheader, LIST_ITEM_PAD_VER);
lv_style_set_pad_bottom(&theme->styles.list_subheader, LIST_PAD);
#endif
#if LV_USE_TABVIEW
style_init_reset(&theme->styles.tabs);
lv_style_set_bg_opa(&theme->styles.tabs, LV_OPA_TRANSP);
lv_style_set_border_color(&theme->styles.tabs, TABS_DIVIDER_COLOR);
lv_style_set_border_width(&theme->styles.tabs, DENSITY_BORDER);
lv_style_set_border_side(&theme->styles.tabs, LV_BORDER_SIDE_BOTTOM);
#endif
#if LV_USE_BUTTON && LV_USE_TABVIEW
style_init_reset(&theme->styles.tab);
lv_style_set_bg_opa(&theme->styles.tab, LV_OPA_TRANSP);
lv_style_set_text_color(&theme->styles.tab, TAB_LABEL_COLOR);
lv_style_set_radius(&theme->styles.tab, 0);
#endif
#if LV_USE_BUTTON && LV_USE_TABVIEW
style_init_reset(&theme->styles.tab_selected);
lv_style_set_text_color(&theme->styles.tab_selected, TAB_SELECTED_LABEL_COLOR);
lv_style_set_border_color(&theme->styles.tab_selected, TAB_INDICATOR_COLOR);
lv_style_set_border_width(&theme->styles.tab_selected, TAB_INDICATOR_WIDTH);
lv_style_set_border_side(&theme->styles.tab_selected, LV_BORDER_SIDE_BOTTOM);
#endif
#if LV_USE_TABVIEW
style_init_reset(&theme->styles.tab_page);
lv_style_set_pad_all(&theme->styles.tab_page, TAB_PAGE_PAD);
#endif
#if LV_USE_MSGBOX
style_init_reset(&theme->styles.dialog);
lv_style_set_bg_color(&theme->styles.dialog, DIALOG_COLOR);
lv_style_set_bg_opa(&theme->styles.dialog, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.dialog, DIALOG_TEXT_COLOR);
lv_style_set_radius(&theme->styles.dialog, DIALOG_SHAPE);
lv_style_set_pad_all(&theme->styles.dialog, 0);
lv_style_set_pad_gap(&theme->styles.dialog, 0);
lv_style_set_clip_corner(&theme->styles.dialog, true);
#endif
#if LV_USE_MSGBOX
style_init_reset(&theme->styles.dialog_header);
lv_style_set_pad_hor(&theme->styles.dialog_header, DIALOG_PAD);
lv_style_set_pad_top(&theme->styles.dialog_header, DIALOG_PAD);
lv_style_set_pad_bottom(&theme->styles.dialog_header, DIALOG_GAP);
lv_style_set_pad_gap(&theme->styles.dialog_header, DIALOG_GAP);
#endif
#if LV_USE_LABEL && LV_USE_MSGBOX
style_init_reset(&theme->styles.dialog_title);
lv_style_set_text_color(&theme->styles.dialog_title, DIALOG_TITLE_COLOR);
lv_style_set_text_font(&theme->styles.dialog_title, theme->config.font_large);
#endif
#if LV_USE_MSGBOX
style_init_reset(&theme->styles.dialog_content);
lv_style_set_pad_hor(&theme->styles.dialog_content, DIALOG_PAD);
lv_style_set_pad_ver(&theme->styles.dialog_content, DIALOG_GAP);
#endif
#if LV_USE_MSGBOX
style_init_reset(&theme->styles.dialog_actions);
lv_style_set_pad_all(&theme->styles.dialog_actions, DIALOG_PAD);
lv_style_set_pad_top(&theme->styles.dialog_actions, DIALOG_GAP);
lv_style_set_pad_gap(&theme->styles.dialog_actions, DIALOG_GAP);
#endif
#if LV_USE_MSGBOX
style_init_reset(&theme->styles.dialog_scrim);
lv_style_set_bg_color(&theme->styles.dialog_scrim, DIALOG_SCRIM_COLOR);
lv_style_set_bg_opa(&theme->styles.dialog_scrim, DIALOG_SCRIM_OPACITY);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings);
lv_style_set_bg_color(&theme->styles.settings, SETTINGS_COLOR);
lv_style_set_bg_opa(&theme->styles.settings, LV_OPA_COVER);
lv_style_set_pad_all(&theme->styles.settings, 0);
lv_style_set_pad_gap(&theme->styles.settings, 0);
lv_style_set_radius(&theme->styles.settings, 0);
lv_style_set_clip_corner(&theme->styles.settings, true);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings_sidebar);
lv_style_set_pad_all(&theme->styles.settings_sidebar, 0);
lv_style_set_pad_gap(&theme->styles.settings_sidebar, 0);
lv_style_set_border_color(&theme->styles.settings_sidebar, SETTINGS_DIVIDER_COLOR);
lv_style_set_border_width(&theme->styles.settings_sidebar, DENSITY_BORDER);
lv_style_set_border_side(&theme->styles.settings_sidebar, LV_BORDER_SIDE_RIGHT);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings_content);
lv_style_set_pad_all(&theme->styles.settings_content, 0);
lv_style_set_pad_gap(&theme->styles.settings_content, 0);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings_page);
lv_style_set_pad_hor(&theme->styles.settings_page, 0);
lv_style_set_pad_gap(&theme->styles.settings_page, 0);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings_header);
lv_style_set_pad_hor(&theme->styles.settings_header, SETTINGS_ITEM_PAD_HOR);
lv_style_set_pad_ver(&theme->styles.settings_header, DENSITY_LIST_PAD);
lv_style_set_pad_gap(&theme->styles.settings_header, SETTINGS_ITEM_GAP);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings_section);
lv_style_set_bg_color(&theme->styles.settings_section, SETTINGS_SECTION_COLOR);
lv_style_set_bg_opa(&theme->styles.settings_section, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.settings_section, SETTINGS_SECTION_SHAPE);
lv_style_set_clip_corner(&theme->styles.settings_section, true);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings_item);
lv_style_set_pad_hor(&theme->styles.settings_item, SETTINGS_ITEM_PAD_HOR);
lv_style_set_pad_ver(&theme->styles.settings_item, SETTINGS_ITEM_PAD_VER);
lv_style_set_pad_gap(&theme->styles.settings_item, SETTINGS_ITEM_GAP);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings_item_selected);
lv_style_set_bg_color(&theme->styles.settings_item_selected, SETTINGS_ITEM_SELECTED_COLOR);
lv_style_set_bg_opa(&theme->styles.settings_item_selected, LV_OPA_COVER);
lv_style_set_text_color(&theme->styles.settings_item_selected, SETTINGS_ITEM_SELECTED_TEXT_COLOR);
#endif
#if LV_USE_MENU
style_init_reset(&theme->styles.settings_separator);
lv_style_set_bg_opa(&theme->styles.settings_separator, LV_OPA_TRANSP);
lv_style_set_pad_ver(&theme->styles.settings_separator, DENSITY_LIST_PAD);
#endif
#if LV_USE_WIN
style_init_reset(&theme->styles.window_header);
lv_style_set_bg_color(&theme->styles.window_header, WINDOW_HEADER_COLOR);
lv_style_set_bg_opa(&theme->styles.window_header, LV_OPA_COVER);
lv_style_set_pad_all(&theme->styles.window_header, WINDOW_HEADER_PAD);
lv_style_set_pad_gap(&theme->styles.window_header, WINDOW_HEADER_PAD);
#endif
#if LV_USE_LABEL && LV_USE_WIN
style_init_reset(&theme->styles.window_title);
lv_style_set_text_font(&theme->styles.window_title, theme->config.font_large);
#endif
#if LV_USE_WIN
style_init_reset(&theme->styles.window_content);
lv_style_set_bg_opa(&theme->styles.window_content, LV_OPA_TRANSP);
lv_style_set_pad_all(&theme->styles.window_content, WINDOW_CONTENT_PAD);
lv_style_set_pad_gap(&theme->styles.window_content, DENSITY_CONTAINER_GAP);
#endif
#if LV_USE_TABLE
style_init_reset(&theme->styles.table);
lv_style_set_bg_color(&theme->styles.table, TABLE_COLOR);
lv_style_set_bg_opa(&theme->styles.table, LV_OPA_COVER);
lv_style_set_pad_all(&theme->styles.table, 0);
lv_style_set_radius(&theme->styles.table, 0);
lv_style_set_border_color(&theme->styles.table, TABLE_DIVIDER_COLOR);
lv_style_set_border_width(&theme->styles.table, DENSITY_BORDER);
#endif
#if LV_USE_TABLE
style_init_reset(&theme->styles.table_cell);
lv_style_set_bg_opa(&theme->styles.table_cell, LV_OPA_TRANSP);
lv_style_set_text_color(&theme->styles.table_cell, TABLE_CELL_TEXT_COLOR);
lv_style_set_pad_all(&theme->styles.table_cell, TABLE_CELL_PAD);
lv_style_set_border_color(&theme->styles.table_cell, TABLE_DIVIDER_COLOR);
lv_style_set_border_width(&theme->styles.table_cell, DENSITY_BORDER);
lv_style_set_border_side(&theme->styles.table_cell, LV_BORDER_SIDE_BOTTOM);
#endif
#if LV_USE_CHART
style_init_reset(&theme->styles.chart);
lv_style_set_bg_color(&theme->styles.chart, CHART_COLOR);
lv_style_set_bg_opa(&theme->styles.chart, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.chart, SHAPE_CONTAINER);
lv_style_set_pad_all(&theme->styles.chart, DENSITY_CONTAINER_PAD);
lv_style_set_line_color(&theme->styles.chart, CHART_GRID_COLOR);
lv_style_set_border_post(&theme->styles.chart, false);
#endif
#if LV_USE_CHART
style_init_reset(&theme->styles.chart_series);
lv_style_set_line_width(&theme->styles.chart_series, CHART_SERIES_WIDTH);
lv_style_set_size(&theme->styles.chart_series, CHART_POINT_SIZE, CHART_POINT_SIZE);
lv_style_set_radius(&theme->styles.chart_series, CHART_POINT_SIZE);
#endif
#if LV_USE_CHART
style_init_reset(&theme->styles.chart_indicator);
lv_style_set_bg_color(&theme->styles.chart_indicator, CHART_INDICATOR_COLOR);
lv_style_set_bg_opa(&theme->styles.chart_indicator, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.chart_indicator, LV_RADIUS_CIRCLE);
lv_style_set_size(&theme->styles.chart_indicator, CHART_POINT_SIZE, CHART_POINT_SIZE);
#endif
#if LV_USE_CALENDAR
style_init_reset(&theme->styles.calendar);
lv_style_set_bg_color(&theme->styles.calendar, CALENDAR_COLOR);
lv_style_set_bg_opa(&theme->styles.calendar, LV_OPA_COVER);
lv_style_set_radius(&theme->styles.calendar, CALENDAR_SHAPE);
lv_style_set_pad_all(&theme->styles.calendar, CALENDAR_PAD);
lv_style_set_pad_gap(&theme->styles.calendar, CALENDAR_PAD);
#endif
#if LV_USE_BUTTONMATRIX && LV_USE_CALENDAR
style_init_reset(&theme->styles.calendar_days);
lv_style_set_bg_opa(&theme->styles.calendar_days, LV_OPA_TRANSP);
lv_style_set_pad_all(&theme->styles.calendar_days, 0);
lv_style_set_pad_gap(&theme->styles.calendar_days, DENSITY_KEY_GAP);
#endif
#if LV_USE_BUTTONMATRIX && LV_USE_CALENDAR
style_init_reset(&theme->styles.calendar_day);
lv_style_set_bg_opa(&theme->styles.calendar_day, LV_OPA_TRANSP);
lv_style_set_text_color(&theme->styles.calendar_day, CALENDAR_DAY_TEXT_COLOR);
lv_style_set_radius(&theme->styles.calendar_day, LV_RADIUS_CIRCLE);
#endif
#if (LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_ARROW) || (LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_DROPDOWN)
style_init_reset(&theme->styles.calendar_header);
lv_style_set_pad_all(&theme->styles.calendar_header, CALENDAR_HEADER_PAD);
lv_style_set_pad_gap(&theme->styles.calendar_header, CALENDAR_HEADER_PAD);
#endif
#if LV_USE_SCALE
style_init_reset(&theme->styles.scale);
lv_style_set_line_color(&theme->styles.scale, SCALE_COLOR);
lv_style_set_line_width(&theme->styles.scale, SCALE_WIDTH);
lv_style_set_arc_color(&theme->styles.scale, SCALE_COLOR);
lv_style_set_arc_width(&theme->styles.scale, SCALE_WIDTH);
lv_style_set_text_color(&theme->styles.scale, SCALE_COLOR);
lv_style_set_length(&theme->styles.scale, SCALE_TICK_LENGTH);
#endif
#if LV_USE_LINE
style_init_reset(&theme->styles.divider);
lv_style_set_line_color(&theme->styles.divider, DIVIDER_COLOR);
lv_style_set_line_width(&theme->styles.divider, DIVIDER_WIDTH);
#endif
#if LV_USE_LED
style_init_reset(&theme->styles.led);
lv_style_set_bg_color(&theme->styles.led, lv_color_white());
lv_style_set_bg_opa(&theme->styles.led, LV_OPA_COVER);
lv_style_set_bg_grad_color(&theme->styles.led, lv_palette_main(LV_PALETTE_GREY));
lv_style_set_radius(&theme->styles.led, LV_RADIUS_CIRCLE);
lv_style_set_shadow_width(&theme->styles.led, LED_GLOW_WIDTH);
lv_style_set_shadow_color(&theme->styles.led, lv_color_white());
lv_style_set_shadow_spread(&theme->styles.led, LED_GLOW_SPREAD);
#endif
}
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_theme_material_config_init(lv_theme_material_config_t * config)
{
lv_memzero(config, sizeof(*config));
config->is_dark = false;
config->is_compact = false;
config->animations_enabled = true;
config->color_primary = lv_color_hex(0x00BBFF);
config->color_secondary = lv_color_hex(0xEE81C3);
config->color_error = lv_color_hex(0xB3261E);
config->font_small = LV_FONT_DEFAULT;
config->font_normal = LV_FONT_DEFAULT;
config->font_large = LV_FONT_DEFAULT;
}
lv_theme_t * lv_theme_material_init(lv_display_t * disp, const lv_theme_material_config_t * config)
{
if(!lv_theme_material_is_inited()) {
theme_def = lv_malloc_zeroed(sizeof(my_theme_t));
LV_ASSERT_MALLOC(theme_def);
}
my_theme_t * theme = theme_def;
lv_display_t * new_disp = disp == NULL ? lv_display_get_default() : disp;
int32_t new_dpi = lv_display_get_dpi(new_disp);
int32_t hor_res = lv_display_get_horizontal_resolution(new_disp);
int32_t ver_res = lv_display_get_vertical_resolution(new_disp);
int32_t greater_res = LV_MAX(hor_res, ver_res);
disp_size_t new_size;
if(greater_res <= 320) new_size = DISP_SMALL;
else if(greater_res < 720) new_size = DISP_MEDIUM;
else new_size = DISP_LARGE;
if(theme->inited && theme->disp_dpi == new_dpi && theme->disp_size == new_size &&
config_equals(&theme->config, config)) {
return (lv_theme_t *) theme;
}
theme->disp_size = new_size;
theme->disp_dpi = new_dpi;
theme->config = *config;
theme->base.disp = new_disp;
theme->base.apply_cb = theme_apply;
theme->base.color_primary = config->color_primary;
theme->base.color_secondary = config->color_secondary;
theme->base.font_small = config->font_small;
theme->base.font_normal = config->font_normal;
theme->base.font_large = config->font_large;
style_init(theme);
if(disp == NULL || lv_display_get_theme(disp) == (lv_theme_t *)theme) {
lv_obj_report_style_change(NULL);
}
theme->inited = true;
/* Re-initialize the styles when the resolution changes, as the display size affects the styles */
lv_display_remove_event_cb_with_user_data(new_disp, resolution_change_event_cb, theme);
lv_display_add_event_cb(new_disp, resolution_change_event_cb, LV_EVENT_RESOLUTION_CHANGED, theme);
return (lv_theme_t *) theme;
}
bool lv_theme_material_is_inited(void)
{
return theme_def != NULL && theme_def->inited;
}
lv_theme_t * lv_theme_material_get(void)
{
if(!lv_theme_material_is_inited()) {
return NULL;
}
return (lv_theme_t *) theme_def;
}
void lv_theme_material_deinit(void)
{
my_theme_t * theme = theme_def;
if(theme) {
if(theme->inited) {
lv_style_t * theme_styles = (lv_style_t *)(&(theme->styles));
uint32_t i;
for(i = 0; i < sizeof(my_theme_styles_t) / sizeof(lv_style_t); i++) {
lv_style_reset(theme_styles + i);
}
}
lv_free(theme_def);
theme_def = NULL;
}
}
/**********************
* STATIC FUNCTIONS
**********************/
static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
{
LV_UNUSED(th);
my_theme_t * theme = theme_def;
lv_obj_t * parent = lv_obj_get_parent(obj);
LV_UNUSED(theme);
LV_UNUSED(parent);
/* null > * */
if(parent == NULL) {
lv_obj_add_style(obj, &theme->styles.screen, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
if(lv_obj_check_type(obj, &lv_obj_class)) {
#if LV_USE_TABVIEW
/* tabview > obj[1] */
if(lv_obj_check_type(parent, &lv_tabview_class) && lss_is_child(parent, 1, obj)) {
return;
}
#endif
#if LV_USE_TABVIEW
/* tabview > obj[0] */
if(lv_obj_check_type(parent, &lv_tabview_class) && lss_is_child(parent, 0, obj)) {
lv_obj_add_style(obj, &theme->styles.tabs, 0);
return;
}
#endif
#if LV_USE_TABVIEW
/* tabview > * > obj */
if(lv_obj_check_type(lss_ancestor(obj, 2), &lv_tabview_class)) {
lv_obj_add_style(obj, &theme->styles.tab_page, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_WIN
/* win > obj[0] */
if(lv_obj_check_type(parent, &lv_win_class) && lss_is_child(parent, 0, obj)) {
lv_obj_add_style(obj, &theme->styles.window_header, 0);
return;
}
#endif
#if LV_USE_WIN
/* win > obj[1] */
if(lv_obj_check_type(parent, &lv_win_class) && lss_is_child(parent, 1, obj)) {
lv_obj_add_style(obj, &theme->styles.window_content, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_CALENDAR
/* calendar > obj */
if(lv_obj_check_type(parent, &lv_calendar_class)) {
return;
}
#endif
/* toolbar > obj */
if(lv_obj_check_type(parent, &lvgl_toolbar_class)) {
lv_obj_add_style(obj, &theme->styles.app_bar_actions, 0);
return;
}
/* obj */
lv_obj_add_style(obj, &theme->styles.container, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#if LV_USE_BUTTON
if(lv_obj_check_type(obj, &lv_button_class)) {
#if LV_USE_TABVIEW
/* tabview > *[0] > button */
if(lv_obj_check_type(lss_ancestor(obj, 2), &lv_tabview_class) && lss_is_child(lss_ancestor(obj, 2), 0, parent)) {
lv_obj_add_style(obj, &theme->styles.tab, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.tab_selected, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
return;
}
#endif
#if LV_USE_MENU
/* menu_sidebar_header_cont > button */
if(lv_obj_check_type(parent, &lv_menu_sidebar_header_cont_class)) {
lv_obj_add_style(obj, &theme->styles.icon_button, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_MENU
/* menu_main_header_cont > button */
if(lv_obj_check_type(parent, &lv_menu_main_header_cont_class)) {
lv_obj_add_style(obj, &theme->styles.icon_button, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_WIN
/* win > obj[0] > button */
if(lv_obj_check_type(lss_ancestor(obj, 2), &lv_win_class) && lv_obj_check_type(parent, &lv_obj_class) && lss_is_child(lss_ancestor(obj, 2), 0, parent)) {
lv_obj_add_style(obj, &theme->styles.icon_button, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
/* button */
lv_obj_add_style(obj, &theme->styles.button, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.button_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.button_checked, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.button_checked_pressed, LV_STATE_CHECKED | LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.button_disabled, LV_STATE_DISABLED);
return;
}
#endif
if(lv_obj_check_type(obj, &lvgl_icon_button_class)) {
/* toolbar > icon_button */
if(lv_obj_check_type(parent, &lvgl_toolbar_class)) {
lv_obj_add_style(obj, &theme->styles.icon_button, 0);
lv_obj_add_style(obj, &theme->styles.app_bar_button, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.app_bar_button_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.app_bar_focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.app_bar_focus_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
/* toolbar > obj > icon_button */
if(lv_obj_check_type(lss_ancestor(obj, 2), &lvgl_toolbar_class) && lv_obj_check_type(parent, &lv_obj_class)) {
lv_obj_add_style(obj, &theme->styles.icon_button, 0);
lv_obj_add_style(obj, &theme->styles.app_bar_button, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.app_bar_button_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.app_bar_focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.app_bar_focus_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
/* icon_button */
lv_obj_add_style(obj, &theme->styles.icon_button, 0);
lv_obj_add_style(obj, &theme->styles.icon_button_selected, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring_inset, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring_inset, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#if LV_USE_DROPDOWN
if(lv_obj_check_type(obj, &lv_dropdown_class)) {
/* toolbar > obj > dropdown */
if(lv_obj_check_type(lss_ancestor(obj, 2), &lvgl_toolbar_class) && lv_obj_check_type(parent, &lv_obj_class)) {
lv_obj_add_style(obj, &theme->styles.field, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
lv_obj_add_style(obj, &theme->styles.app_bar_field, 0);
lv_obj_add_style(obj, &theme->styles.app_bar_focus_ring, LV_STATE_FOCUS_KEY);
return;
}
/* dropdown */
lv_obj_add_style(obj, &theme->styles.field, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
if(lv_obj_check_type(obj, &lvgl_toolbar_class)) {
/* toolbar */
lv_obj_add_style(obj, &theme->styles.app_bar, 0);
return;
}
if(lv_obj_check_type(obj, &lvgl_icon_button_filled_class)) {
/* icon_button_filled */
lv_obj_add_style(obj, &theme->styles.icon_button_filled, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.icon_button_filled_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.button_disabled, LV_STATE_DISABLED);
return;
}
if(lv_obj_check_type(obj, &lvgl_icon_button_tonal_class)) {
/* icon_button_tonal */
lv_obj_add_style(obj, &theme->styles.icon_button_tonal, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.icon_button_tonal_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.button_disabled, LV_STATE_DISABLED);
return;
}
#if LV_USE_MSGBOX
if(lv_obj_check_type(obj, &lv_msgbox_header_button_class)) {
/* msgbox_header_button */
lv_obj_add_style(obj, &theme->styles.icon_button, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_MSGBOX
if(lv_obj_check_type(obj, &lv_msgbox_footer_button_class)) {
/* msgbox_footer_button */
lv_obj_add_style(obj, &theme->styles.text_button, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.text_button_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_LABEL
if(lv_obj_check_type(obj, &lv_label_class)) {
#if LV_USE_MSGBOX
/* msgbox_header > label */
if(lv_obj_check_type(parent, &lv_msgbox_header_class)) {
lv_obj_add_style(obj, &theme->styles.dialog_title, 0);
return;
}
#endif
#if LV_USE_WIN
/* win > obj[0] > label */
if(lv_obj_check_type(lss_ancestor(obj, 2), &lv_win_class) && lv_obj_check_type(parent, &lv_obj_class) && lss_is_child(lss_ancestor(obj, 2), 0, parent)) {
lv_obj_add_style(obj, &theme->styles.window_title, 0);
return;
}
#endif
#if LV_USE_TEXTAREA
/* textarea > label */
if(lv_obj_check_type(parent, &lv_textarea_class)) {
lv_obj_add_style(obj, &theme->styles.field_selection, LV_PART_SELECTED);
return;
}
#endif
return;
}
#endif
#if LV_USE_SWITCH
if(lv_obj_check_type(obj, &lv_switch_class)) {
/* switch */
lv_obj_add_style(obj, &theme->styles.switch_track, 0);
lv_obj_add_style(obj, &theme->styles.switch_track_selected, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.switch_indicator_selected, LV_PART_INDICATOR | LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.switch_handle, LV_PART_KNOB);
lv_obj_add_style(obj, &theme->styles.switch_handle_selected, LV_PART_KNOB | LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.switch_handle_pressed, LV_PART_KNOB | LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_CHECKBOX
if(lv_obj_check_type(obj, &lv_checkbox_class)) {
/* checkbox */
lv_obj_add_style(obj, &theme->styles.checkbox, 0);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.checkbox_box, LV_PART_INDICATOR);
lv_obj_add_style(obj, &theme->styles.checkbox_box_selected, LV_PART_INDICATOR | LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.transition_exit, LV_PART_INDICATOR);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_PART_INDICATOR | LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
if(lv_obj_check_type(obj, &lvgl_card_class)) {
/* card */
lv_obj_add_style(obj, &theme->styles.card, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
return;
}
if(lv_obj_check_type(obj, &lvgl_sliderbox_class)) {
/* sliderbox */
lv_obj_add_style(obj, &theme->styles.sliderbox, 0);
return;
}
#if LV_USE_SLIDER
if(lv_obj_check_type(obj, &lv_slider_class)) {
/* slider */
lv_obj_add_style(obj, &theme->styles.slider_track, 0);
lv_obj_add_style(obj, &theme->styles.slider_track_size, 0);
lv_obj_add_style(obj, &theme->styles.slider_knob_room, 0);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.slider_active_track, LV_PART_INDICATOR);
lv_obj_add_style(obj, &theme->styles.slider_handle, LV_PART_KNOB);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_BAR
if(lv_obj_check_type(obj, &lv_bar_class)) {
/* bar */
lv_obj_add_style(obj, &theme->styles.progress_track, 0);
lv_obj_add_style(obj, &theme->styles.progress_indicator, LV_PART_INDICATOR);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
return;
}
#endif
#if LV_USE_ARC
if(lv_obj_check_type(obj, &lv_arc_class)) {
/* arc */
lv_obj_add_style(obj, &theme->styles.arc_track, 0);
lv_obj_add_style(obj, &theme->styles.arc_indicator, LV_PART_INDICATOR);
lv_obj_add_style(obj, &theme->styles.arc_handle, LV_PART_KNOB);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
return;
}
#endif
#if LV_USE_SPINNER
if(lv_obj_check_type(obj, &lv_spinner_class)) {
/* spinner */
lv_obj_add_style(obj, &theme->styles.arc_track, 0);
lv_obj_add_style(obj, &theme->styles.arc_indicator, LV_PART_INDICATOR);
return;
}
#endif
#if LV_USE_TEXTAREA
if(lv_obj_check_type(obj, &lv_textarea_class)) {
/* textarea */
lv_obj_add_style(obj, &theme->styles.field, 0);
lv_obj_add_style(obj, &theme->styles.field_focused, LV_STATE_FOCUSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
lv_obj_add_style(obj, &theme->styles.field_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED);
lv_obj_add_style(obj, &theme->styles.field_placeholder, LV_PART_TEXTAREA_PLACEHOLDER);
return;
}
#endif
#if LV_USE_SPINBOX
if(lv_obj_check_type(obj, &lv_spinbox_class)) {
/* spinbox */
lv_obj_add_style(obj, &theme->styles.field, 0);
lv_obj_add_style(obj, &theme->styles.field_focused, LV_STATE_FOCUSED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.spinbox_cursor, LV_PART_CURSOR);
return;
}
#endif
#if LV_USE_DROPDOWN
if(lv_obj_check_type(obj, &lv_dropdownlist_class)) {
/* dropdownlist */
lv_obj_add_style(obj, &theme->styles.menu, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
lv_obj_add_style(obj, &theme->styles.menu_item, LV_PART_SELECTED);
lv_obj_add_style(obj, &theme->styles.menu_item_selected, LV_PART_SELECTED | LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_PART_SELECTED | LV_STATE_PRESSED);
return;
}
#endif
#if LV_USE_ROLLER
if(lv_obj_check_type(obj, &lv_roller_class)) {
/* roller */
lv_obj_add_style(obj, &theme->styles.roller, 0);
lv_obj_add_style(obj, &theme->styles.roller_selected, LV_PART_SELECTED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
return;
}
#endif
#if LV_USE_BUTTONMATRIX
if(lv_obj_check_type(obj, &lv_buttonmatrix_class)) {
#if LV_USE_CALENDAR
/* calendar > buttonmatrix */
if(lv_obj_check_type(parent, &lv_calendar_class)) {
lv_obj_add_style(obj, &theme->styles.calendar_days, 0);
lv_obj_add_style(obj, &theme->styles.calendar_day, LV_PART_ITEMS);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.key_selected, LV_PART_ITEMS | LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_PART_ITEMS | LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_PART_ITEMS | LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED);
return;
}
#endif
/* buttonmatrix */
lv_obj_add_style(obj, &theme->styles.keys, 0);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.key, LV_PART_ITEMS);
lv_obj_add_style(obj, &theme->styles.key_pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.key_selected, LV_PART_ITEMS | LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_PART_ITEMS | LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_KEYBOARD
if(lv_obj_check_type(obj, &lv_keyboard_class)) {
/* keyboard */
lv_obj_add_style(obj, &theme->styles.keys, 0);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.key, LV_PART_ITEMS);
lv_obj_add_style(obj, &theme->styles.key_pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.key_checked, LV_PART_ITEMS | LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.key_selected, LV_PART_ITEMS | LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_LIST
if(lv_obj_check_type(obj, &lv_list_class)) {
/* list */
lv_obj_add_style(obj, &theme->styles.list, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_LIST
if(lv_obj_check_type(obj, &lv_list_text_class)) {
/* list_text */
lv_obj_add_style(obj, &theme->styles.list_subheader, 0);
return;
}
#endif
#if LV_USE_LIST
if(lv_obj_check_type(obj, &lv_list_button_class)) {
/* list_button */
lv_obj_add_style(obj, &theme->styles.list_item, 0);
lv_obj_add_style(obj, &theme->styles.transition_exit, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.transition_enter, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.list_item_focused, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED);
return;
}
#endif
#if LV_USE_TABLE
if(lv_obj_check_type(obj, &lv_table_class)) {
/* table */
lv_obj_add_style(obj, &theme->styles.table, 0);
lv_obj_add_style(obj, &theme->styles.focus_ring, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.edit_ring, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
lv_obj_add_style(obj, &theme->styles.table_cell, LV_PART_ITEMS);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_PART_ITEMS | LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.list_item_focused, LV_PART_ITEMS | LV_STATE_FOCUS_KEY);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_class)) {
/* menu */
lv_obj_add_style(obj, &theme->styles.settings, 0);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_sidebar_cont_class)) {
/* menu_sidebar_cont */
lv_obj_add_style(obj, &theme->styles.settings_sidebar, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_main_cont_class)) {
/* menu_main_cont */
lv_obj_add_style(obj, &theme->styles.settings_content, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_page_class)) {
/* menu_page */
lv_obj_add_style(obj, &theme->styles.settings_page, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_sidebar_header_cont_class)) {
/* menu_sidebar_header_cont */
lv_obj_add_style(obj, &theme->styles.settings_header, 0);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_main_header_cont_class)) {
/* menu_main_header_cont */
lv_obj_add_style(obj, &theme->styles.settings_header, 0);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_section_class)) {
/* menu_section */
lv_obj_add_style(obj, &theme->styles.settings_section, 0);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_cont_class)) {
/* menu_cont */
lv_obj_add_style(obj, &theme->styles.settings_item, 0);
lv_obj_add_style(obj, &theme->styles.state_pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.settings_item_selected, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.settings_item_selected, LV_STATE_FOCUS_KEY);
return;
}
#endif
#if LV_USE_MENU
if(lv_obj_check_type(obj, &lv_menu_separator_class)) {
/* menu_separator */
lv_obj_add_style(obj, &theme->styles.settings_separator, 0);
return;
}
#endif
#if LV_USE_MSGBOX
if(lv_obj_check_type(obj, &lv_msgbox_class)) {
/* msgbox */
lv_obj_add_style(obj, &theme->styles.dialog, 0);
return;
}
#endif
#if LV_USE_MSGBOX
if(lv_obj_check_type(obj, &lv_msgbox_backdrop_class)) {
/* msgbox_backdrop */
lv_obj_add_style(obj, &theme->styles.dialog_scrim, 0);
return;
}
#endif
#if LV_USE_MSGBOX
if(lv_obj_check_type(obj, &lv_msgbox_header_class)) {
/* msgbox_header */
lv_obj_add_style(obj, &theme->styles.dialog_header, 0);
return;
}
#endif
#if LV_USE_MSGBOX
if(lv_obj_check_type(obj, &lv_msgbox_content_class)) {
/* msgbox_content */
lv_obj_add_style(obj, &theme->styles.dialog_content, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_MSGBOX
if(lv_obj_check_type(obj, &lv_msgbox_footer_class)) {
/* msgbox_footer */
lv_obj_add_style(obj, &theme->styles.dialog_actions, 0);
return;
}
#endif
#if LV_USE_TABVIEW
if(lv_obj_check_type(obj, &lv_tabview_class)) {
/* tabview */
lv_obj_add_style(obj, &theme->styles.page, 0);
return;
}
#endif
#if LV_USE_WIN
if(lv_obj_check_type(obj, &lv_win_class)) {
/* win */
lv_obj_add_style(obj, &theme->styles.page, 0);
return;
}
#endif
#if LV_USE_TILEVIEW
if(lv_obj_check_type(obj, &lv_tileview_class)) {
/* tileview */
lv_obj_add_style(obj, &theme->styles.page, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_TILEVIEW
if(lv_obj_check_type(obj, &lv_tileview_tile_class)) {
/* tileview_tile */
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
return;
}
#endif
#if LV_USE_CHART
if(lv_obj_check_type(obj, &lv_chart_class)) {
/* chart */
lv_obj_add_style(obj, &theme->styles.chart, 0);
lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR);
lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED);
lv_obj_add_style(obj, &theme->styles.chart_series, LV_PART_ITEMS);
lv_obj_add_style(obj, &theme->styles.chart_indicator, LV_PART_INDICATOR);
lv_obj_add_style(obj, &theme->styles.chart_series, LV_PART_CURSOR);
return;
}
#endif
#if LV_USE_CALENDAR
if(lv_obj_check_type(obj, &lv_calendar_class)) {
/* calendar */
lv_obj_add_style(obj, &theme->styles.calendar, 0);
return;
}
#endif
#if LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_ARROW
if(lv_obj_check_type(obj, &lv_calendar_header_arrow_class)) {
/* calendar_header_arrow */
lv_obj_add_style(obj, &theme->styles.calendar_header, 0);
return;
}
#endif
#if LV_USE_CALENDAR && LV_USE_CALENDAR_HEADER_DROPDOWN
if(lv_obj_check_type(obj, &lv_calendar_header_dropdown_class)) {
/* calendar_header_dropdown */
lv_obj_add_style(obj, &theme->styles.calendar_header, 0);
return;
}
#endif
#if LV_USE_SCALE
if(lv_obj_check_type(obj, &lv_scale_class)) {
/* scale */
lv_obj_add_style(obj, &theme->styles.scale, LV_PART_MAIN);
lv_obj_add_style(obj, &theme->styles.scale, LV_PART_INDICATOR);
lv_obj_add_style(obj, &theme->styles.scale, LV_PART_ITEMS);
return;
}
#endif
#if LV_USE_LINE
if(lv_obj_check_type(obj, &lv_line_class)) {
/* line */
lv_obj_add_style(obj, &theme->styles.divider, 0);
return;
}
#endif
#if LV_USE_LED
if(lv_obj_check_type(obj, &lv_led_class)) {
/* led */
lv_obj_add_style(obj, &theme->styles.led, 0);
return;
}
#endif
}
static void style_init_reset(lv_style_t * style)
{
if(lv_theme_material_is_inited()) {
lv_style_reset(style);
}
else {
lv_style_init(style);
}
}
static void resolution_change_event_cb(lv_event_t * e)
{
lv_display_t * disp = lv_event_get_target(e);
my_theme_t * theme = lv_event_get_user_data(e);
lv_theme_material_init(disp, &theme->config);
}