| 105 | } |
| 106 | |
| 107 | void ModuleWidget::setPanel(widget::Widget* panel) { |
| 108 | // Remove existing panel |
| 109 | if (internal->panel) { |
| 110 | removeChild(internal->panel); |
| 111 | delete internal->panel; |
| 112 | internal->panel = NULL; |
| 113 | } |
| 114 | |
| 115 | if (panel) { |
| 116 | addChildBottom(panel); |
| 117 | internal->panel = panel; |
| 118 | box.size.x = std::round(panel->box.size.x / RACK_GRID_WIDTH) * RACK_GRID_WIDTH; |
| 119 | // If width is zero, set it to 12HP for sanity |
| 120 | if (box.size.x == 0.0) |
| 121 | box.size.x = 12 * RACK_GRID_WIDTH; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | void ModuleWidget::setPanel(std::shared_ptr<window::Svg> svg) { |
| 126 | // Create SvgPanel |
nothing calls this directly
no test coverage detected