Allow to set panel orientation only for expanded panels

Also fix initial position of non-expanded panels