'From Cuis 1.0 of 2 July 2009 [latest update: #215] on 16 July 2009 at 10:59:33 pm'!

!MenuMorph methodsFor: 'private' stamp: 'jmv 7/16/2009 22:49'!
adjustSubmorphsLayout
	"Enlarge the width of submorphs as needed
	so all of them are have the same width, and no less than #minWidth.
	Also adjust their vertical position.
	Finally, set our own extent."
	
	| w p tl |
	
	submorphs isEmpty ifTrue: [ ^self ].
	w _ submorphs inject: 0 into: [ :prev :each |
		prev max: (
			(each respondsTo: #minItemWidth)
				ifTrue: [each minItemWidth]
				ifFalse: [each width])].

	tl _ bounds topLeft.
	p _ tl + 5.
	submorphs do: [ :m |
		m width: w.
		m position: p.
		p _ m bounds bottomLeft + (0@2) ].
	
	self extent: submorphs last bottomRight - tl + 5! !

