how can i space the rows?
#include "GridMidi.h"
GridMidi::GridMidi(const Array<File>& midiFiles)
{
// Create MidiDragComponent instances and add them to the OwnedArray
for (int i = 0; i < numFiles; ++i)
{
auto* component = new MidiDragComponent(midiFiles[i], MidiFileTypeFunctions::fromString(midiFiles[i].getFileName())); // Replace with
// Create a FlexItem for each MidiDragComponent and add to FlexBox
flexBox.items.add(FlexItem(*component)
.withMinWidth(midiDragWidth) // Set fixed width
.withMinHeight(midiDragHeight) // Set fixed height
.withMaxWidth(midiDragWidth) // Ensure max width is also set
.withMaxHeight(midiDragHeight) // Ensure max height is also set
.withFlex(0.0f)); // Do not stretch, keep fixed size
}
}
void GridMidi::paint(Graphics& g)
{
// Transparent background
g.fillAll(Colours::transparentBlack);
//draw black outline
g.setColour(Colours::black);
g.drawRect(getLocalBounds(), 1.0f);
}
void GridMidi::resized()
{
// Set up FlexBox layout
flexBox.flexWrap = FlexBox::Wrap::wrap;
flexBox.flexDirection = FlexBox::Direction::row;
flexBox.justifyContent = FlexBox::JustifyContent::spaceBetween;// rows space
flexBox.alignContent = FlexBox::AlignContent::spaceAround;// columns space
// Set a fixed size for the grid container to ensure proper layout
auto bounds = getLocalBounds().toFloat();
flexBox.performLayout(Rectangle(bounds.getWidth(), bounds.getHeight() - 200));
}

