|
|
|
@@ -33,7 +33,8 @@ Image juce_createIconForFile (const File& file); |
|
|
|
//==============================================================================
|
|
|
|
FileListComponent::FileListComponent (DirectoryContentsList& listToShow)
|
|
|
|
: ListBox ({}, nullptr),
|
|
|
|
DirectoryContentsDisplayComponent (listToShow)
|
|
|
|
DirectoryContentsDisplayComponent (listToShow),
|
|
|
|
lastDirectory (listToShow.getDirectory())
|
|
|
|
{
|
|
|
|
setModel (this);
|
|
|
|
directoryContentsList.addChangeListener (this);
|
|
|
|
@@ -70,12 +71,15 @@ void FileListComponent::setSelectedFile (const File& f) |
|
|
|
{
|
|
|
|
if (directoryContentsList.getFile(i) == f)
|
|
|
|
{
|
|
|
|
fileWaitingToBeSelected = File();
|
|
|
|
|
|
|
|
selectRow (i);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
deselectAllRows();
|
|
|
|
fileWaitingToBeSelected = f;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
@@ -85,9 +89,13 @@ void FileListComponent::changeListenerCallback (ChangeBroadcaster*) |
|
|
|
|
|
|
|
if (lastDirectory != directoryContentsList.getDirectory())
|
|
|
|
{
|
|
|
|
fileWaitingToBeSelected = File();
|
|
|
|
lastDirectory = directoryContentsList.getDirectory();
|
|
|
|
deselectAllRows();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fileWaitingToBeSelected != File())
|
|
|
|
setSelectedFile (fileWaitingToBeSelected);
|
|
|
|
}
|
|
|
|
|
|
|
|
//==============================================================================
|
|
|
|
|