Switching between stacked and grouped orientation