closed #5176, refactor UILayout and focus