DrawableButton edgeIndent accessor (Feature Request)

Hi there. I’m currently working on a button class derived from DrawableButton. Thankfully, DrawableButton::getImageBounds() is virtual, so I can override it. But edgeIndent is private, so my derived class can’t access it.

My only options seem to be to either shadow DrawableButton::edgeIndent, or to derive from Button and reproduce the DrawableButton functionality that I need. Neither of which seem too great. I was wondering if there could be a getEdgeIndent().

1 Like

Do you need to directly mutate the variable? There is the setEdgeIndent method:

    //==============================================================================
    /** Gives the button an optional amount of space around the edge of the drawable.
        By default there's a gap of about 3 pixels.
    */
    void setEdgeIndent (int numPixelsIndent);

I think the big issue is that there is no
int getEdgeIndent() const

So if you’re trying to override
Rectangle<float> DrawableButton::getImageBounds() const
In order to change the edgeIndent behaviour, to remove the jmin behaviour, for example
You aren’t able to access the edgeIndent that has been set

bump

PR: https://github.com/WeAreROLI/JUCE/pull/228