@@ -471,10 +471,19 @@ api:
|
||||
if (!id(is_uploading_tft) and !(id.empty())) {
|
||||
if (!(icon.empty())) disp1->set_component_text_printf("%s_icon", id.c_str(), icon.c_str());
|
||||
if (icon_color.size() == 3) set_component_color->execute((id + "_icon").c_str(), icon_color);
|
||||
if (visible) {
|
||||
disp1->show_component(id.c_str());
|
||||
} else {
|
||||
disp1->hide_component(id.c_str());
|
||||
bool IsCurrentPage = true;
|
||||
size_t dotPos = id.find(".");
|
||||
if (dotPos != std::string::npos) {
|
||||
std::string left_side = id.substr(0, dotPos);
|
||||
if (left_side == "alarm_control_panel") left_side = "alarm";
|
||||
if (left_side != current_page->state) IsCurrentPage = false;
|
||||
}
|
||||
if (IsCurrentPage) {
|
||||
if (visible) {
|
||||
disp1->show_component(id.c_str());
|
||||
} else {
|
||||
disp1->hide_component(id.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user