| 719 | } |
| 720 | |
| 721 | WidgetConstructResult WidgetParser::progressHandler(String const& name, Json const& config) { |
| 722 | String background, overlay; |
| 723 | ImageStretchSet progressSet; |
| 724 | |
| 725 | background = config.get("background", "").toString(); |
| 726 | overlay = config.get("overlay", "").toString(); |
| 727 | progressSet = parseImageStretchSet(config.get("progressSet")); |
| 728 | GuiDirection direction = GuiDirectionNames.getLeft(config.getString("direction", "horizontal")); |
| 729 | |
| 730 | auto progress = make_shared<ProgressWidget>(background, overlay, progressSet, direction); |
| 731 | |
| 732 | common(progress, config); |
| 733 | |
| 734 | if (config.contains("barColor")) |
| 735 | progress->setColor(jsonToColor(config.get("barColor"))); |
| 736 | |
| 737 | if (config.contains("max")) |
| 738 | progress->setMaxProgressLevel(config.getFloat("max")); |
| 739 | |
| 740 | if (config.contains("initial")) |
| 741 | progress->setCurrentProgressLevel(config.getFloat("initial")); |
| 742 | |
| 743 | return WidgetConstructResult(progress, name, config.getFloat("zlevel", 0)); |
| 744 | } |
| 745 | |
| 746 | WidgetConstructResult WidgetParser::stackHandler(String const& name, Json const& config) { |
| 747 | auto stack = make_shared<StackWidget>(); |
nothing calls this directly
no test coverage detected