Introducing JIVE - the ultimate JUCE extension for building GUIs

I want JIVE to feel “native” to JUCE - it should feel familiar and comfortable for anyone who’s used JUCE for even just a short while. For that reason it should support only what is strictly necessery for developers to achieve whatever it is they need to achieve.

For example, JUCE doesn’t have any equivalent to HTML’s <ul> (unordered list). If you want a bullet-point list in JUCE you’d have to write you own custom Component class and build it from scratch. I’ll leave it up to your own imagination what that might entail, my guess would be ~150 lines of code.

JIVE doesn’t have an unordered-list type either, however what it does have is the ability to build one from scratch using relatively few lines of code. For example you might do something like this:

[[nodiscard]] auto listItem(const juce::String& item)
{
    return juce::ValueTree {
        "Component",
        {
            { "flex-direction", "row" },
        },
        {
            juce::ValueTree::fromXml ("<svg> ... </svg>"), // Bullet icon
            juce::ValueTree { "Text", { "text", item } },
        },
    };
}

[[nodiscard]] auto unorderedList(const juce::StringArray& items)
{
    juce::ValueTree view{
        "Component",
        {
            { "padding", "0 0 0 20" },
        },
    };

    for (const auto& item : items)
        view.appendChild(listItem(item), nullptr);

    return view;
}

Two functions of less than 15 lines of code to do the equivalent of a 100+ line-of-code class is exactly what JIVE is built for.

1 Like