| 554 | } |
| 555 | |
| 556 | WidgetConstructResult WidgetParser::listHandler(String const& name, Json const& config) { |
| 557 | Json schema; |
| 558 | try { |
| 559 | schema = config.get("schema"); |
| 560 | } catch (MapException const& e) { |
| 561 | throw WidgetParserException( |
| 562 | strf("Malformed gui json, missing a required value in the map. {}", outputException(e, false))); |
| 563 | } |
| 564 | |
| 565 | auto list = make_shared<ListWidget>(schema); |
| 566 | common(list, config); |
| 567 | |
| 568 | if (auto callback = m_callbacks.value(config.getString("callback", name))) |
| 569 | list->setCallback(callback); |
| 570 | |
| 571 | list->setFillDown(config.getBool("fillDown", false)); |
| 572 | list->setColumns(config.getUInt("columns", 1)); |
| 573 | |
| 574 | return WidgetConstructResult(list, name, config.getFloat("zlevel", 0)); |
| 575 | } |
| 576 | |
| 577 | WidgetConstructResult WidgetParser::sliderHandler(String const& name, Json const& config) { |
| 578 | try { |
nothing calls this directly
no test coverage detected