| 443 | } |
| 444 | |
| 445 | WidgetConstructResult WidgetParser::labelHandler(String const& name, Json const& config) { |
| 446 | String text = config.getString("value", ""); |
| 447 | |
| 448 | Color color = Color::White; |
| 449 | if (config.contains("color")) |
| 450 | color = jsonToColor(config.get("color")); |
| 451 | HorizontalAnchor hAnchor = HorizontalAnchorNames.getLeft(config.getString("hAnchor", "left")); |
| 452 | VerticalAnchor vAnchor = VerticalAnchorNames.getLeft(config.getString("vAnchor", "bottom")); |
| 453 | |
| 454 | auto label = make_shared<LabelWidget>(text, color, hAnchor, vAnchor); |
| 455 | common(label, config); |
| 456 | if (config.contains("fontSize")) |
| 457 | label->setFontSize(config.getInt("fontSize")); |
| 458 | if (config.contains("wrapWidth")) |
| 459 | label->setWrapWidth(config.getInt("wrapWidth")); |
| 460 | if (config.contains("charLimit")) |
| 461 | label->setTextCharLimit(config.getInt("charLimit")); |
| 462 | if (config.contains("lineSpacing")) |
| 463 | label->setLineSpacing(config.getFloat("lineSpacing")); |
| 464 | if (config.contains("directives")) |
| 465 | label->setDirectives(config.getString("directives")); |
| 466 | |
| 467 | return WidgetConstructResult(label, name, config.getFloat("zlevel", 0)); |
| 468 | } |
| 469 | |
| 470 | WidgetConstructResult WidgetParser::itemSlotHandler(String const& name, Json const& config) { |
| 471 | String backingImage = config.getString("backingImage", ""); |
nothing calls this directly
no test coverage detected