refactor Button restrict capInsetSize logic and cleanup ui coding style

This PR mainly focus on refactoring.
The method of restricting capInsetSize of scale9 renderer are duplicated, I have merged them.

And we should add the check in other Scale9Enabled widgets, I will do it in another PR.