FileTreeComponent textColour


#1

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).


#2

Ok, thanks, I’ll sort that out.


#3

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


#4

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


#5

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?


#6

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


#7

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.


#8

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