Improved UI resize callback