[squeak-dev] The Inbox: Morphic-ct.1855.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jan 22 16:53:42 UTC 2022

A new version of Morphic was added to project The Inbox:

==================== Summary ====================

Name: Morphic-ct.1855
Author: ct
Time: 22 January 2022, 5:53:35.957739 pm
UUID: a884bbaa-fd98-8346-8712-0f4339f60d6e
Ancestors: Morphic-mt.1854

Fixes occlusion of docking bar menus by the docking bar when the menu is taller than the world. As the docking bar is displayed in front of its menus, the first menu's item would not be visible otherwise.

Note that in the long term, we might want to add a scroll bar to menus that do not fit into the screen.

=============== Diff against Morphic-mt.1854 ===============

Item was added:
+ ----- Method: DockingBarItemMorph>>clearAreaForSubmenus (in category 'accessing') -----
+ clearAreaForSubmenus
+ 	"The receiver is displayed behind any docking bars (which have a smaller morphic layer number) and thus must not cross them."
+ 	^ self world clearArea!

Item was added:
+ ----- Method: MenuItemMorph>>clearAreaForSubmenus (in category 'accessing') -----
+ clearAreaForSubmenus
+ 	^ self worldBounds!

Item was changed:
  ----- Method: MenuMorph>>popUpAdjacentTo:forHand:from: (in category 'control') -----
  popUpAdjacentTo: rightOrLeftPoint forHand: hand from: sourceItem 
  	"Present this menu at the given point under control of the given hand."
  	| tryToPlace selectedOffset rightPoint leftPoint |
  	hand world startSteppingSubmorphsOf: self.
  	popUpOwner := sourceItem.
  	self fullBounds.
  	self updateColor.
  	"ensure layout is current"
  	selectedOffset := (selectedItem
  				ifNil: [self items first]) position - self position.
  	tryToPlace := [:where :mustFit | | delta | 
  			self position: where - selectedOffset.
+ 			delta := (self boundsInWorld insetBy: self layoutInset) amountToTranslateWithin: sourceItem clearAreaForSubmenus.
- 			delta := self boundsInWorld amountToTranslateWithin: sourceItem worldBounds.
  			(delta x = 0
  					or: [mustFit])
  				ifTrue: [delta = (0 @ 0)
  						ifFalse: [self position: self position + delta].
  					sourceItem world addMorphFront: self.
  					^ self]].
  	rightPoint := rightOrLeftPoint first + ((self layoutInset + self borderWidth) @ 0).
  	leftPoint := rightOrLeftPoint last + ((self layoutInset + self borderWidth - self width) @ 0).
  		value: rightPoint value: false;
  		 value: leftPoint value: false;
  		 value: rightPoint value: true.!

More information about the Squeak-dev mailing list