This add ability to decide in the look and feel how to layout the FileBrowserComponent.
juce_FileBrowserComponent:
[code]void FileBrowserComponent::resized()
{
getLookAndFeel().layoutFileBrowserComponent (*this,
fileListComponent,
previewComp,
currentPathBox,
filenameBox,
goUpButton);
}[/code]
LookAndFeel.h:
[code]
class FileBrowserComponent;
class DirectoryContentsDisplayComponent;
class FilePreviewComponent;
// …
virtual void layoutFileBrowserComponent (FileBrowserComponent& browserComp,
DirectoryContentsDisplayComponent* fileListComponent,
FilePreviewComponent* previewComp,
ComboBox* currentPathBox,
TextEditor* filenameBox,
Button* goUpButton);[/code]
LookAndFeel.cpp
#include "../filebrowser/juce_FilenameComponent.h"
#include "../filebrowser/juce_FileBrowserComponent.h"
// ...
void LookAndFeel::layoutFileBrowserComponent (FileBrowserComponent& browserComp,
DirectoryContentsDisplayComponent* fileListComponent,
FilePreviewComponent* previewComp,
ComboBox* currentPathBox,
TextEditor* filenameBox,
Button* goUpButton)
{
const int x = 8;
int w = browserComp.getWidth() - x - x;
if (previewComp != 0)
{
const int previewWidth = w / 3;
previewComp->setBounds (x + w - previewWidth, 0, previewWidth, browserComp.getHeight());
w -= previewWidth + 4;
}
int y = 4;
const int controlsHeight = 22;
const int bottomSectionHeight = controlsHeight + 8;
const int upButtonWidth = 50;
currentPathBox->setBounds (x, y, w - upButtonWidth - 6, controlsHeight);
goUpButton->setBounds (x + w - upButtonWidth, y, upButtonWidth, controlsHeight);
y += controlsHeight + 4;
Component* const listAsComp = dynamic_cast <Component*> (fileListComponent);
listAsComp->setBounds (x, y, w, browserComp.getHeight() - y - bottomSectionHeight);
y = listAsComp->getBottom() + 4;
filenameBox->setBounds (x + 50, y, w - 50, controlsHeight);
}
hope to see checked in !!