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

Marcel Taeumel marcel.taeumel at hpi.de
Sun Jan 23 07:47:06 UTC 2022

Hi Christoph --


For, I would just use this:

delta := self innerBounds amountToTranslateWithin: sourceItem world visibleClearArea.

Am 22.01.2022 17:53:56 schrieb commits at source.squeak.org <commits at source.squeak.org>:
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.!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220123/b20eb716/attachment.html>

More information about the Squeak-dev mailing list