Dynamic calculation of the buttons total width