MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / getUsableRect

Method getUsableRect

Source/UIComponents/CtrlrComponents/CtrlrComponent.cpp:294–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294Rectangle<int> CtrlrComponent::getUsableRect()
295{
296 Rectangle<int> r = Component::getLocalBounds();
297 if ((bool)getProperty(Ids::componentLabelVisible) == false)
298 {
299 return (r);
300 }
301
302 if (getProperty(Ids::componentLabelPosition) == Ids::top.toString())
303 {
304 return (r.removeFromBottom(componentNameLabel.getHeight()).withTop(componentNameLabel.getHeight()));
305 }
306
307 if (getProperty(Ids::componentLabelPosition) == Ids::bottom.toString())
308 {
309 return (r.withHeight(r.getHeight()-componentNameLabel.getHeight()));
310 }
311
312 if (getProperty(Ids::componentLabelPosition) == Ids::left.toString())
313 {
314 return (r.withLeft (componentNameLabel.getWidth()).withWidth(r.getWidth() - componentNameLabel.getWidth()));
315 }
316
317 if (getProperty(Ids::componentLabelPosition) == Ids::right.toString())
318 {
319 r.removeFromRight (componentNameLabel.getWidth());
320 return (r);
321 }
322 return (r);
323}
324
325void CtrlrComponent::valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property)
326{

Callers

nothing calls this directly

Calls 9

removeFromBottomMethod · 0.80
removeFromRightMethod · 0.80
toStringMethod · 0.45
withTopMethod · 0.45
getHeightMethod · 0.45
withHeightMethod · 0.45
withWidthMethod · 0.45
withLeftMethod · 0.45
getWidthMethod · 0.45

Tested by

no test coverage detected