MCPcopy Create free account
hub / github.com/DISTRHO/DPF / onResize

Function onResize

examples/FileHandling/FileHandlingUI.cpp:186–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 }
185
186 void onResize(const ResizeEvent& ev) override
187 {
188 fScale = static_cast<float>(ev.size.getHeight())/kInitialHeight;
189
190 fButton1.setAbsolutePos(5*fScale, 5*fScale);
191 fButton2.setAbsolutePos(5*fScale, 105*fScale);
192 fButton3.setAbsolutePos(5*fScale, 205*fScale);
193
194 fButton1.setSize(100*fScale, 30*fScale);
195 fButton2.setSize(100*fScale, 30*fScale);
196 fButton3.setSize(100*fScale, 30*fScale);
197
198 fButton1.setFontScale(fScale);
199 fButton2.setFontScale(fScale);
200 fButton3.setFontScale(fScale);
201
202 UI::onResize(ev);
203 }
204
205 void buttonClicked(SubWidget* const widget, int) override
206 {

Callers

nothing calls this directly

Calls 4

setFontScaleMethod · 0.80
getHeightMethod · 0.45
setAbsolutePosMethod · 0.45
setSizeMethod · 0.45

Tested by

no test coverage detected