PluginListComponent lookandFeel

I’m tearing my hair out here trying to set a PluginListComponent lookAndFeel. It appears Ok when first launched
image
…but the popup menu and scanning windows show a V2 lookAndFeel?

image

The code is posted below, it’s more or less lifted straight from the AudioPluginHost demo. Any ideas how I can get the LookAndFeel to propagate through all child components?

class MainComponent::PluginListWindow  : public DocumentWindow
{
public:
    PluginListWindow (MainComponent& mw, AudioPluginFormatManager& pluginFormatManager)
    : DocumentWindow ("Available Plugins",
                      LookAndFeel::getDefaultLookAndFeel().findColour (ResizableWindow::backgroundColourId),
                      DocumentWindow::minimiseButton | DocumentWindow::closeButton),
    owner (mw)
    {
        setLookAndFeel(&lookAndFeel);

		auto deadMansPedalFile = owner.getSettings()->getUserSettings()->getFile().getSiblingFile ("RecentlyCrashedPluginsList");
        
        setContentOwned (new PluginListComponent (pluginFormatManager,
                                                  owner.knownPluginList,
                                                  deadMansPedalFile,
                                                  owner.getSettings()->getUserSettings(), true), true);
		
        setResizable (true, false);
        setResizeLimits (300, 400, 1200, 500);
        setTopLeftPosition (60, 60);
        
        restoreWindowStateFromString (owner.getSettings()->getUserSettings()->getValue ("listWindowPos"));
        setVisible (true);
    }
    
    ~PluginListWindow()
    {
        setLookAndFeel(nullptr);
        owner.getSettings()->getUserSettings()->setValue ("listWindowPos", getWindowStateAsString());
        clearContentComponent();
    }
    
    void closeButtonPressed() override
    {
        owner.pluginListWindow = nullptr;
    }
    
private:
    MainComponent& owner;
    LookAndFeel_V4 lookAndFeel;
    
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PluginListWindow)
};
};

Iterating through all child componnts and manually setting the look and feel doesn’t work either?

	    for (auto& c : this->getChildren())
		{
			c->setLookAndFeel(&lookAndFeel);
			c->lookAndFeelChanged();
		}

I came across this thread today as I had a similar issue. Since this was unanswered, here’s what I found out. To apply a LookAndFeel to the menu of the Options button, you can subclass the PluginListComponent, and then override:

PopupMenu PluginListComponent2::createOptionsMenu()

…and then set the menu that is created inside it to have the LookAndFeel:

    // first, create the entire menu in the super-class
    PopupMenu menu = PluginListComponent::createOptionsMenu();
    
    menu.setLookAndFeel(&getLookAndFeel());
1 Like