MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / setPanel

Method setPanel

src/override/ModuleWidget.cpp:107–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void 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
125void ModuleWidget::setPanel(std::shared_ptr<window::Svg> svg) {
126 // Create SvgPanel

Callers

nothing calls this directly

Calls 1

setBackgroundMethod · 0.80

Tested by

no test coverage detected