Comment 3 for bug 1204286

Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote :

This is *exactly* the way I would do it. It's a pretty flexible approach, and it simplifies widget-specific code as much as possible.

I would, however, reconsider naming. Names containing "NoMargin" would be silly to call, because whatever wants to use them, would imply that it is interested in a particular version of the width/height.

Maybe names as "GetMinimalHeight" and "GetTotalMinimalHeight" or "GetInnerMinimalHeight" and "GetMinimalHeight" would be more clear.
Personally, I'd go for the second option, because it can be extended to OnClicked: IDrawable's "OnClicked" would call widget-specific methods "OnMarginClicked" and "OnInnerClicked".
"Insides" instead of "Inner" could do the trick too.