The changes below should be part of _loadCurrentState(), we don't want to do those expensive layout calculations twice.