Adjust layout of the elements according to the orientation