Fix the UI layout of query view