MCPcopy Create free account
hub / github.com/StrangeLoopsAudio/gRainbow / resized

Method resized

Source/Components/Modulators/EnvPanel.cpp:135–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135void EnvPanel::resized() {
136 auto r = getLocalBounds().reduced(Utils::PADDING);
137
138 // Labels
139 auto labelPanel = r.removeFromBottom(Utils::LABEL_HEIGHT);
140 const int labelWidth = labelPanel.getWidth() / 4;
141 mLabelAttack.setBounds(labelPanel.removeFromLeft(labelWidth));
142 mLabelDecay.setBounds(labelPanel.removeFromLeft(labelWidth));
143 mLabelSustain.setBounds(labelPanel.removeFromLeft(labelWidth));
144 mLabelRelease.setBounds(labelPanel.removeFromLeft(labelWidth));
145
146 // Sliders
147 auto knobPanel = r.removeFromBottom(Utils::KNOB_HEIGHT);
148 const int knobWidth = knobPanel.getWidth() / 4;
149 mSliderAttack.setBounds(knobPanel.removeFromLeft(knobWidth).withSizeKeepingCentre(Utils::KNOB_HEIGHT * 2, Utils::KNOB_HEIGHT));
150 mSliderDecay.setBounds(knobPanel.removeFromLeft(knobWidth).withSizeKeepingCentre(Utils::KNOB_HEIGHT * 2, Utils::KNOB_HEIGHT));
151 mSliderSustain.setBounds(knobPanel.removeFromLeft(knobWidth).withSizeKeepingCentre(Utils::KNOB_HEIGHT * 2, Utils::KNOB_HEIGHT));
152 mSliderRelease.setBounds(knobPanel.removeFromLeft(knobWidth).withSizeKeepingCentre(Utils::KNOB_HEIGHT * 2, Utils::KNOB_HEIGHT));
153
154 auto rightPanel = r.removeFromRight(r.getWidth() * 0.25f);
155
156 r.removeFromRight(Utils::PADDING);
157 r.removeFromBottom(Utils::PADDING);
158
159 mVizRect = r.toFloat();
160
161 mBtnMap.setBounds(rightPanel.removeFromTop(mVizRect.getHeight() / 2));
162
163}

Callers

nothing calls this directly

Calls 1

getHeightMethod · 0.80

Tested by

no test coverage detected