28 auto bounds = getLocalBounds();
35 auto componentBounds =
43 auto flex = FlexItem(*c)
45 .withHeight((
float)componentBounds.getHeight())
46 .withWidth((
float)componentBounds.getWidth())
47 .withOrder(
static_cast<int>(componentBounds.getHeight() / 10) * -1);
52 fb.performLayout(bounds);
58 auto componentBounds =
63 c->setBounds(componentBounds);
78 m_layoutTree.copyPropertiesAndChildrenFrom(layoutTree,
nullptr);
96 addSlot(component.getComponentID(), bounds);
110 auto bounds = Rectangle<int>::fromString(slot[
Property::bounds].toString());
115 if (c->getName() == name)
117 c->addAndMakeVisible(component);
168 comp->setBounds(bounds);
170 addAndMakeVisible(comp);
176 comp->addComponentListener(
this);
195 if (c->getName() == name)
220 auto bounds = newBounds;
Definition CustomLayout.h:14
void resized() override
Definition CustomLayout.cpp:23
void configureAutoLayout(FlexBox flexboxSettings, FlexItem::Margin margin)
Definition CustomLayout.cpp:227
std::function< Rectangle< int >(String componentType, Rectangle< int > currentBounds)> getAutoLayoutBoundsFromType
Used to look up what bounds should be used for a given component type when using auto layout....
Definition CustomLayout.h:134
~CustomLayout()
Definition CustomLayout.cpp:21
void setLayoutTree(const ValueTree &layoutTree)
Definition CustomLayout.h:52
void valueTreePropertyChanged(ValueTree &treeWhosePropertyHasChanged, const Identifier &property) override
Definition CustomLayout.cpp:199
ValueTree & getLayoutTree()
Definition CustomLayout.cpp:68
static const String FileExtension
Definition CustomLayout.h:31
FlexBox m_flexSettings
Definition CustomLayout.h:147
ValueTree m_layoutTree
Definition CustomLayout.h:142
void valueTreeRedirected(ValueTree &treeWhichHasBeenChanged)
Definition CustomLayout.cpp:204
bool m_editable
Definition CustomLayout.h:144
void valueTreeChildAdded(ValueTree &parentTree, ValueTree &childWhichHasBeenAdded) override
Definition CustomLayout.cpp:181
static const Rectangle< int > DefaultSize
Definition CustomLayout.h:32
CustomLayout()
Definition CustomLayout.cpp:15
void addComponent(Component &component, Rectangle< int > bounds=CustomLayout::DefaultSize)
Definition CustomLayout.cpp:94
void saveLayout()
Definition CustomLayout.cpp:147
void resetLayoutTree(const ValueTree &layoutTree)
Definition CustomLayout.cpp:75
FlexItem::Margin m_flexMargin
Definition CustomLayout.h:148
void componentMovedOrResized(Component &component, bool wasMoved, bool wasResized) override
Definition CustomLayout.cpp:212
void valueTreeChildRemoved(ValueTree &parentTree, ValueTree &childWhichHasBeenRemoved, int indexFromWhichChildWasRemoved) override
Definition CustomLayout.cpp:189
OwnedArray< Component > m_components
Definition CustomLayout.h:141
bool m_autoLayout
Definition CustomLayout.h:146
void addSlot(const String &name, const Rectangle< int > &bounds)
Definition CustomLayout.cpp:82
bool isEditModeActive()
Definition CustomLayout.h:111
void removeComponent(int index)
Definition CustomLayout.cpp:130
std::function< void()> treeRedirected
Definition CustomLayout.h:138
Component * createAndAddResizableComponent(String name, Rectangle< int > bounds)
Definition CustomLayout.cpp:161
void setEditModeActive(bool isEditModeActive)
Definition CustomLayout.cpp:137
Definition ResizableComponent.h:15
Definition AirAbsorptionFilter.cpp:2
static const Identifier name
Definition CustomLayout.h:26
static const Identifier index
Definition CustomLayout.h:27
static const Identifier bounds
Definition CustomLayout.h:28
Definition CustomLayout.h:19
static const Identifier slot
Definition CustomLayout.h:21
static const Identifier layout
Definition CustomLayout.h:20