Added support for vertical item layout (e.g. when docked to the top)