FileTreeComponent textColour

silly little bug … setting textColourId (or highlightColourId) on a fileTreeComponent seems to have no effect (on mac anyway).

fileTreeComp->setColour(FileTreeComponent::textColourId, Colours::white);
fileTreeComp->setColour(FileTreeComponent::highlightColourId, Colours::white);

Using findColour, I can verify that the colour has indeed been set (but it still paints as black).

Ok, thanks, I’ll sort that out.

any luck here? Still seems wrong, though maybe I’m missing something.

It actually calls LookAndFeel::drawFileBrowserRow, which uses DirectoryContentsDisplayComponent::textColourId for its colour, so just set that instead, I guess.

This doesn’t seem to have worked:

    addAndMakeVisible (fileTreeComp = new FileTreeComponent (*directoryList));
		fileTreeComp->setDragAndDropDescription(T("File Tree"));
		fileTreeComp->setRootItemVisible(false);
		fileTreeComp->setOpenCloseButtonsVisible(true);
		fileTreeComp->setIndentSize(5);
		fileTreeComp->setColour(FileTreeComponent::textColourId, Colours::white);
		fileTreeComp->setColour(FileTreeComponent::highlightColourId, Colours::white);
		fileTreeComp->setColour(DirectoryContentsDisplayComponent::textColourId, Colours::white);

Any other possibilities?

Well, it definitely uses DirectoryContentsDisplayComponent::textColourId… Maybe try debugging the paint operation and watch what happens in there?

Here we are …

You have to use :
fileTreeComp->getLookAndFeel().setColour(DirectoryContentsDisplayComponent::textColourId, Colours::white);

instead of :
fileTreeComp->setColour(DirectoryContentsDisplayComponent::textColourId, Colours::white);

not sure I get that, shouldn’t they be the same?
Never have used the LookAndFeel stuff … but whatever, there’s the way.

hello,

I also face this issue and lost some time before finding this thread.
Would be much more intuitive if
fileTreeComp->setColour(DirectoryContentsDisplayComponent::textColourId, Colours::white);
worked right away, without going thru the look and feel.

Thanks,

Salvator