Lines Matching refs:c
33 static void app_card_create(lv_demo_high_res_ctx_t * c, lv_obj_t * parent, const char * text,
55 lv_demo_high_res_ctx_t * c = lv_obj_get_user_data(base_obj); in lv_demo_high_res_home() local
64 …lv_subject_add_observer_obj(&c->th, lv_demo_high_res_theme_observer_image_src_cb, bg_img, &c->imgs… in lv_demo_high_res_home()
70 lv_obj_set_style_pad_top(bg_cont, c->sz->gap[7], 0); in lv_demo_high_res_home()
75 … c->sz == &lv_demo_high_res_sizes_all[SIZE_SM] ? c->sz->gap[9] : c->sz->gap[10], false, c); in lv_demo_high_res_home()
82 lv_obj_set_style_pad_left(info_area, c->sz->gap[10], 0); in lv_demo_high_res_home()
83 lv_obj_set_style_pad_right(info_area, c->sz->gap[10], 0); in lv_demo_high_res_home()
88 …lv_obj_t * date_and_time = lv_demo_high_res_simple_container_create(info_area, true, c->sz->gap[4], in lv_demo_high_res_home()
92 lv_obj_add_style(date, &c->fonts[FONT_HEADING_MD], 0); in lv_demo_high_res_home()
93 lv_obj_add_style(date, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_TEXT], 0); in lv_demo_high_res_home()
96 lv_subject_add_observer_obj(&c->th, theme_observer_accent_span_cb, date, day_and_month); in lv_demo_high_res_home()
97 lv_subject_add_observer_obj(&c->subject_groups.date.group, date_observer_cb, date, c); in lv_demo_high_res_home()
100 lv_obj_add_style(time, &c->fonts[FONT_HEADING_XXL], 0); in lv_demo_high_res_home()
101 lv_obj_add_style(time, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_TEXT], 0); in lv_demo_high_res_home()
104 lv_subject_add_observer_obj(&c->th, theme_observer_accent_span_cb, time, minute); in lv_demo_high_res_home()
105 lv_subject_add_observer_obj(&c->subject_groups.time.group, time_observer_cb, time, c); in lv_demo_high_res_home()
108 …lv_obj_t * weather_left = lv_demo_high_res_simple_container_create(weather, true, c->sz->gap[2], L… in lv_demo_high_res_home()
111 lv_image_set_src(weather_img, c->imgs[IMG_WEATHER]); in lv_demo_high_res_home()
112 lv_obj_add_style(weather_img, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_A8_IMG], 0); in lv_demo_high_res_home()
114 …lv_obj_t * weather_left_bottom = lv_demo_high_res_simple_container_create(weather_left, true, c->s… in lv_demo_high_res_home()
119 lv_obj_add_style(weather_label, &c->styles[STYLE_COLOR_ACCENT][STYLE_TYPE_TEXT], 0); in lv_demo_high_res_home()
120 lv_obj_add_style(weather_label, &c->fonts[FONT_LABEL_MD], 0); in lv_demo_high_res_home()
123 lv_obj_add_style(weather_hi_lo_label, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_TEXT], 0); in lv_demo_high_res_home()
124 lv_obj_add_style(weather_hi_lo_label, &c->fonts[FONT_LABEL_MD], 0); in lv_demo_high_res_home()
125 …lv_subject_add_observer_obj(&c->temperature_units_are_celsius, hi_lo_observer_cb, weather_hi_lo_la… in lv_demo_high_res_home()
127 …lv_obj_t * weather_right = lv_demo_high_res_simple_container_create(weather, true, c->sz->gap[2], … in lv_demo_high_res_home()
130 lv_obj_add_style(weather_temperature_label, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_TEXT], 0); in lv_demo_high_res_home()
131 lv_obj_add_style(weather_temperature_label, &c->fonts[FONT_HEADING_XL], 0); in lv_demo_high_res_home()
132 …igh_res_label_bind_temperature(weather_temperature_label, &c->api.subjects.temperature_outdoor, c); in lv_demo_high_res_home()
136 …lv_obj_add_style(weather_temperature_location_label, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_TEXT]… in lv_demo_high_res_home()
137 lv_obj_add_style(weather_temperature_location_label, &c->fonts[FONT_LABEL_MD], 0); in lv_demo_high_res_home()
144 lv_obj_set_style_pad_bottom(apps, c->sz->gap[10], 0); in lv_demo_high_res_home()
145 lv_obj_set_style_pad_left(apps, c->sz->gap[10], 0); in lv_demo_high_res_home()
146 lv_obj_set_style_pad_right(apps, c->sz->gap[10], 0); in lv_demo_high_res_home()
152 lv_obj_set_style_pad_column(apps, c->sz->gap[6], 0); in lv_demo_high_res_home()
153 …app_card_create(c, apps, "EV Charging", c->imgs[IMG_EV_CHARGING_APP_ICON], lv_demo_high_res_app_ev… in lv_demo_high_res_home()
154 …app_card_create(c, apps, "Smart Home", c->imgs[IMG_SMART_HOME_APP_ICON], lv_demo_high_res_app_smar… in lv_demo_high_res_home()
155 …app_card_create(c, apps, "Smart Meter", c->imgs[IMG_SMART_METER_APP_ICON], lv_demo_high_res_app_sm… in lv_demo_high_res_home()
156 …app_card_create(c, apps, "Thermostat", c->imgs[IMG_THERMOSTAT_APP_ICON], lv_demo_high_res_app_ther… in lv_demo_high_res_home()
157 app_card_create(c, apps, "About", c->imgs[IMG_ABOUT_APP_ICON], lv_demo_high_res_app_about); in lv_demo_high_res_home()
163 lv_obj_set_size(bottom_margin, LV_PCT(100), c->sz->home_bottom_margin_height); in lv_demo_high_res_home()
166 lv_obj_set_style_pad_left(bottom_margin, c->sz->gap[10], 0); in lv_demo_high_res_home()
167 lv_obj_set_style_pad_right(bottom_margin, c->sz->gap[10], 0); in lv_demo_high_res_home()
170 lv_obj_set_height(logo, c->sz->icon[1]); in lv_demo_high_res_home()
172 lv_image_set_src(logo, c->logo_path); in lv_demo_high_res_home()
177 …lv_obj_t * theme_selector = lv_demo_high_res_simple_container_create(bottom_margin, false, c->sz->… in lv_demo_high_res_home()
179 lv_obj_set_style_pad_all(theme_selector, c->sz->gap[1], 0); /* for icon outline */ in lv_demo_high_res_home()
180 …lv_obj_set_style_pad_right(bottom_margin, lv_obj_get_style_pad_right(bottom_margin, 0) - c->sz->ga… in lv_demo_high_res_home()
185 lv_obj_add_style(theme_label, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_TEXT], 0); in lv_demo_high_res_home()
186 lv_obj_add_style(theme_label, &c->fonts[FONT_LABEL_SM], 0); in lv_demo_high_res_home()
191 …if(((const lv_demo_high_res_theme_t *) lv_subject_get_pointer(&c->th)) == &lv_demo_high_res_theme_… in lv_demo_high_res_home()
193 lv_obj_add_style(light_theme_icon, &c->styles[STYLE_COLOR_ACCENT][STYLE_TYPE_OBJ], 0); in lv_demo_high_res_home()
194 …lv_subject_add_observer_obj(&c->th, lv_demo_high_res_theme_observer_image_src_cb, light_theme_icon, in lv_demo_high_res_home()
195 &c->imgs[IMG_LIGHT_LIGHT_THEME_ICON]); in lv_demo_high_res_home()
200 …if(((const lv_demo_high_res_theme_t *) lv_subject_get_pointer(&c->th)) == &lv_demo_high_res_theme_… in lv_demo_high_res_home()
202 lv_obj_add_style(dark_theme_icon, &c->styles[STYLE_COLOR_ACCENT][STYLE_TYPE_OBJ], 0); in lv_demo_high_res_home()
203 … lv_subject_add_observer_obj(&c->th, lv_demo_high_res_theme_observer_image_src_cb, dark_theme_icon, in lv_demo_high_res_home()
204 &c->imgs[IMG_LIGHT_DARK_THEME_ICON]); in lv_demo_high_res_home()
208 lv_obj_add_event_cb(light_theme_icon, set_light_theme_event_cb, LV_EVENT_CLICKED, c); in lv_demo_high_res_home()
211 lv_obj_add_event_cb(dark_theme_icon, set_dark_theme_event_cb, LV_EVENT_CLICKED, c); in lv_demo_high_res_home()
236 static void app_card_create(lv_demo_high_res_ctx_t * c, lv_obj_t * parent, const char * text, in app_card_create() argument
242 lv_obj_set_size(app_card, c->sz->card_long_edge, c->sz->card_short_edge); in app_card_create()
243 lv_obj_set_style_radius(app_card, c->sz->gap[6], 0); in app_card_create()
245 lv_obj_set_style_pad_all(app_card, c->sz->gap[7], 0); in app_card_create()
246 lv_obj_add_style(app_card, &c->styles[STYLE_COLOR_ACCENT][STYLE_TYPE_OBJ], 0); in app_card_create()
252 lv_obj_add_style(label, &c->styles[STYLE_COLOR_BASE][STYLE_TYPE_TEXT], 0); in app_card_create()
253 lv_obj_add_style(label, &c->fonts[FONT_LABEL_MD], 0); in app_card_create()
262 lv_obj_add_style(icon, &c->styles[STYLE_COLOR_ACCENT][STYLE_TYPE_A8_IMG], 0); in app_card_create()
273 lv_demo_high_res_ctx_t * c = lv_event_get_user_data(e); in set_light_theme_event_cb() local
275 const lv_demo_high_res_theme_t * th = lv_subject_get_pointer(&c->th); in set_light_theme_event_cb()
278 lv_subject_set_pointer(&c->th, (void *)&lv_demo_high_res_theme_light); in set_light_theme_event_cb()
288 lv_demo_high_res_ctx_t * c = lv_event_get_user_data(e); in set_dark_theme_event_cb() local
290 const lv_demo_high_res_theme_t * th = lv_subject_get_pointer(&c->th); in set_dark_theme_event_cb()
293 lv_subject_set_pointer(&c->th, (void *)&lv_demo_high_res_theme_dark); in set_dark_theme_event_cb()
300 lv_demo_high_res_ctx_t * c = lv_observer_get_user_data(observer); in time_observer_cb() local
304 lv_snprintf(buf, sizeof(buf), "%02"LV_PRId32, lv_subject_get_int(&c->api.subjects.hour)); in time_observer_cb()
307 lv_snprintf(buf, sizeof(buf), ":%02"LV_PRId32, lv_subject_get_int(&c->api.subjects.minute)); in time_observer_cb()
315 lv_demo_high_res_ctx_t * c = lv_observer_get_user_data(observer); in date_observer_cb() local
319 lv_snprintf(buf, sizeof(buf), "%s, ", lv_subject_get_pointer(&c->api.subjects.week_day_name)); in date_observer_cb()
321 lv_snprintf(buf, sizeof(buf), "%"PRId32" %s", lv_subject_get_int(&c->api.subjects.month_day), in date_observer_cb()
322 lv_subject_get_pointer(&c->api.subjects.month_name)); in date_observer_cb()