LookAndFeel getLabelFont method breaks getComboBoxFont styling

I always forget it too! So I made a pair of helper functions, getGuiClass & setGuiClass, and added them to my local library (as part of a module). Then I don’t have to worry about typos in the property name either…

namespace ref
{
	namespace IDs
	{
		const juce::Identifier guiClass ("guiClass");
	}

	inline String getGuiClass (const Component& c)
	{
		return c.getProperties()[IDs::guiClass];
	}

	inline void setGuiClass (Component& c, const String className)
	{
		c.getProperties().set (IDs::guiClass, className);
	}

}
2 Likes