A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1683.mcz==================== Summary ====================
Name: Morphic-ct.1683
Author: ct
Time: 29 September 2020, 3:45:11.774971 pm
UUID: fb544fe9-159d-8443-8946-e2651331750f
Ancestors: Morphic-dtl.1680
Fixes an abandoning bug in menu items. When clicking on a menu item that has a submenu, the menu should not disappear! In addition, do not deselect a menu item once it is clicked, which is not important for regular menus but looks confusing when the menu is configured to #stayUp.
=============== Diff against Morphic-dtl.1680 ===============
Item was changed:
----- Method: MenuItemMorph>>invokeWithEvent: (in category 'events') -----
invokeWithEvent: evt
"Perform the action associated with the given menu item."
self isEnabled ifFalse: [^ self].
+ (owner notNil and: [self isStayUpItem not] and: [self hasSubMenu not]) ifTrue: [
- (owner notNil and: [self isStayUpItem not]) ifTrue: [
self flag: #workAround. "The tile system invokes menus straightforwardly so the menu might not be in the world."
self world ifNotNil: [:world |
owner deleteIfPopUp: evt.
"Repair damage before invoking the action for better feedback"
world displayWorldSafely]].
selector ifNil: [^ self].
Cursor normal showWhile: [
"show cursor in case item opens a new MVC window"
selector numArgs isZero
ifTrue: [target perform: selector]
ifFalse: [target perform: selector withArguments: (
selector numArgs = arguments size
ifTrue: [arguments]
ifFalse: [arguments copyWith: evt] )] ].!
Item was changed:
----- Method: MenuItemMorph>>mouseUp: (in category 'events') -----
mouseUp: evt
"Handle a mouse up event. Menu items get activated when the mouse is over them. Do nothing if we're not in a 'valid menu transition', meaning that the current hand focus must be aimed at the owning menu."
+
-
evt hand mouseFocus == owner ifFalse: [ ^self ].
self contentString ifNotNil: [
self contents: self contentString withMarkers: true inverse: true.
self refreshWorld.
(Delay forMilliseconds: 200) wait ].
+ "self deselect: evt."
+ self invokeWithEvent: evt. !
- self deselect: evt.
- self invokeWithEvent: evt.
- !