I’ve noticed that the look and feel of the fileBrowserGoUp button is created in the FIleBrowserDialogue constructor. Should its look and feel update if you call a setLookAndFeel() after creating the FileBrowserDialog? In my custom look and feel class I have overridden createFileBrowserGoUpButton() but it never gets called. It keeps calling the Juce one. Here’s what I do:
FileBrowserComponent browser (FileBrowserComponent::canSelectFiles|FileBrowserComponent::saveMode, File::nonexistent, &wildcardFilter, nullptr);
FileChooserDialogBox dialogBox (“Open some kind of file”, “Please choose…”, browser, false, Colours::black);
dialogBox.setLookAndFeel(basicLookAndFeel);
browser.setLookAndFeel(basicLookAndFeel);
So I’ve hit this problem with another component now. I’m using a PropertyPanel. I have set my own look and feel, and have overridden the getDefaultScrollbarWidth() virtual function. But my propertypanel never calls it, which causes a sigrev when this function gets called:
I have just run into the same thing. I cannot override the createFileBrowserGoUpButton method in LookAndFeel.
My suspicion is that this is happening because createFileBrowserGoUpButton is called in FileBrowserComponent’s constructor, before I have a chance to apply my custom LookAndFeel.
I am called setDefaultLookAndFeel() as in my AudioProcessorEditor’s constructor, but by then it is too late: FileBrowserComponent’s constructor has already run. Is there any way I can call setDefaultLookAndFeel earlier, or instantiate FileBrowserComponent later?
I also notice that I cannot change FileBrowserComponent’s “go up” arrow colour by overriding TextButton::textColourOffId, even when using sendLookAndFeelChange() after defining my custom colour.
I suspect this is because FileBrowserComponent’s lookAndFeelChanged() method does not update the colour of the goUpbutton.
I am happy to report that I was able to solve this one, thanks to a very instructive post by @lalala in this thread: Best place for custom look instantiation in a plugin?, which explains how to call setDefaultLookAndFeel before AudioProcessorEditor’s other members have instantiated.
Glad you got it sorted. Looks like I did too but it’s such a long time ago now I don’t recall how But yes, thank heaven for the forum. It’s saved many a developer!