Move UI layout calculations to resize() method