#179474 by JirkaRybka and pwolanin: proper depth counting for menu tabs when parents are missing inbetween