Skip to content

Commit 3b3a595

Browse files
committed
fix: Fix standby button
1 parent a9732a8 commit 3b3a595

4 files changed

Lines changed: 375 additions & 354 deletions

File tree

eez-ui/gaggimate.eez-project

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13188,7 +13188,15 @@
1318813188
"childStyles": []
1318913189
},
1319013190
"timeline": [],
13191-
"eventHandlers": [],
13191+
"eventHandlers": [
13192+
{
13193+
"objID": "b17cead4-a946-4a64-a172-599833c982a3",
13194+
"eventName": "CLICKED",
13195+
"handlerType": "action",
13196+
"action": "onStandby",
13197+
"userData": 0
13198+
}
13199+
],
1319213200
"identifier": "standbyIcon",
1319313201
"leftUnit": "px",
1319413202
"topUnit": "px",

src/display/ui/default/eez/screens.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,17 @@ static void event_handler_cb_dials_pressure_gauge(lv_event_t *e) {
873873
}
874874
}
875875

876+
static void event_handler_cb_dials_standby_icon(lv_event_t *e) {
877+
lv_event_code_t event = lv_event_get_code(e);
878+
void *flowState = lv_event_get_user_data(e);
879+
(void)flowState;
880+
881+
if (event == LV_EVENT_CLICKED) {
882+
e->user_data = (void *)0;
883+
action_on_standby(e);
884+
}
885+
}
886+
876887
static void event_handler_cb_dials_menu_icon(lv_event_t *e) {
877888
lv_event_code_t event = lv_event_get_code(e);
878889
void *flowState = lv_event_get_user_data(e);
@@ -5332,6 +5343,7 @@ void create_user_widget_dials(lv_obj_t *parent_obj, void *flowState, int startWi
53325343
lv_obj_set_pos(obj, 0, 210);
53335344
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
53345345
lv_img_set_src(obj, &img_power_40x40);
5346+
lv_obj_add_event_cb(obj, event_handler_cb_dials_standby_icon, LV_EVENT_ALL, flowState);
53355347
lv_obj_add_flag(obj, LV_OBJ_FLAG_CLICKABLE);
53365348
lv_obj_set_style_align(obj, LV_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
53375349
lv_obj_set_style_img_recolor(obj, lv_color_hex(theme_colors[eez_flow_get_selected_theme_index()][0]),

0 commit comments

Comments
 (0)