Don't change the width of the button. Also simplify logic of finding max width. (cherry picked from commit b4b55d6a)