File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ static const theme_option_t k_theme_options[] = {
6666 {"midnight" , "Midnight" },
6767};
6868
69+ static const size_t kThemeOptionCount = sizeof (k_theme_options ) / sizeof (k_theme_options [0 ]);
70+
6971static const char * k_theme_options_list = "System Default\nSolar\nMidnight" ;
7072
7173static const struct
@@ -550,7 +552,7 @@ static void theme_state_async_cb(void* param)
550552
551553 if (ctx -> theme_dropdown != NULL && payload -> variant_id [0 ] != '\0' )
552554 {
553- for (uint32_t i = 0 ; i < LV_ARRAY_SIZE ( k_theme_options ) ; i ++ )
555+ for (uint32_t i = 0 ; i < kThemeOptionCount ; i ++ )
554556 {
555557 if (strcmp (k_theme_options [i ].id , payload -> variant_id ) == 0 )
556558 {
@@ -678,7 +680,7 @@ static void theme_dropdown_cb(lv_event_t* event)
678680 if (ctx -> actions_bound && ctx -> actions .set_theme_variant != NULL )
679681 {
680682 uint16_t index = lv_dropdown_get_selected (lv_event_get_target (event ));
681- if (index < LV_ARRAY_SIZE ( k_theme_options ) )
683+ if (index < kThemeOptionCount )
682684 {
683685 ctx -> actions .set_theme_variant (k_theme_options [index ].id , ctx -> actions_user_data );
684686 }
You can’t perform that action at this time.
0 commit comments