Customizing IncDecButton Slider with LookAndFeel

I want to customize an IncDecButton Slider with a custom LookAndFeel class. Using the code below, how can I differentiate between the Inc and Dec buttons to rotate the arrows correctly?

        void drawButtonBackground(juce::Graphics& g, juce::Button& button, const juce::Colour& backgroundColour, bool isMouseOverButton, bool isButtonDown) override
        {
            // Draw Background
            g.setColour(backgroundColour);
            g.fillRect(button.getLocalBounds());

            // Draw Arrow
            juce::Path trianglePath;
            trianglePath.addTriangle(juce::Point<float>(0,0),juce::Point<float>(0, button.getHeight()),juce::Point<float>(button.getWidth(), button.getHeight()*0.5f));
            g.setColour(juce::Colours::white);
            g.fillPath(trianglePath);
        }

Thanks for any suggestions!

Based on this, which is used to create the buttons:

Button* LookAndFeel_V2::createSliderButton (Slider&, const bool isIncrement)
{
    return new TextButton (isIncrement ? "+" : "-", String());
}

I believe you can just query the name, i.e.

if (button.getName() == "+")
1 Like