Fix macros tab controlling other printers

This commit is contained in:
suchmememanyskill
2024-03-13 18:46:13 +01:00
parent d0d80e8980
commit 36b37176d6
3 changed files with 9 additions and 1 deletions

View File

@@ -40,9 +40,14 @@ void macros_add_power_devices_to_panel(lv_obj_t * root_panel, POWERQUERY query)
}
}
void macros_draw_power_fullscreen(PRINTER_CONFIG * config)
void macros_set_current_config(PRINTER_CONFIG * config)
{
curernt_config = config;
}
void macros_draw_power_fullscreen(PRINTER_CONFIG * config)
{
macros_set_current_config(config);
lv_obj_t * parent = lv_create_empty_panel(lv_scr_act());
lv_obj_set_style_bg_opa(parent, LV_OPA_100, 0);

View File

@@ -5,5 +5,6 @@
void macros_add_macros_to_panel(lv_obj_t * root_panel, MACROSQUERY query);
void macros_add_power_devices_to_panel(lv_obj_t * root_panel, POWERQUERY query);
void macros_set_current_config(PRINTER_CONFIG * config);
void macros_draw_power_fullscreen(PRINTER_CONFIG * config);
void macros_draw_power_fullscreen();

View File

@@ -11,6 +11,8 @@ static void btn_goto_settings(lv_event_t * e){
}
void macros_panel_init(lv_obj_t* panel) {
macros_set_current_config(get_current_printer_config());
lv_obj_t * btn = lv_btn_create(panel);
lv_obj_add_event_cb(btn, btn_goto_settings, LV_EVENT_CLICKED, NULL);
lv_obj_set_size(btn, CYD_SCREEN_PANEL_WIDTH_PX - CYD_SCREEN_GAP_PX * 2, CYD_SCREEN_MIN_BUTTON_HEIGHT_PX);