auto format button on resize