[squeak-dev] The Inbox: Morphic-rh.588.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Nov 3 18:03:15 UTC 2011

radoslav hodnicak uploaded a new version of Morphic to project The Inbox:

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

Name: Morphic-rh.588
Author: rh
Time: 3 November 2011, 7:01:45.493 pm
UUID: 3e2f3cae-c241-4206-aa83-98bb145399c3
Ancestors: Morphic-ul.587

Disable menu dragging unless the mouse is over the menu's title bar. I can't count the number of times I've unintentionally dragged a menu around after opening it instead of clicking a menu item.

=============== Diff against Morphic-ul.587 ===============

Item was changed:
  ----- Method: MenuMorph>>mouseDown: (in category 'events') -----
  mouseDown: evt
+ 	| titleMorph |
  	"Handle a mouse down event."
  	(stayUp or:[self fullContainsPoint: evt position]) 
  		ifFalse:[^self deleteIfPopUp: evt]. "click outside"
  	self isSticky ifTrue: [^self].
+ 	"Grab the menu and drag it to some other place only if the mouse is grabbing the title bar"
+ 	self valueOfProperty: #hasTitlebarWidgets ifAbsent: [^self].
+ 	titleMorph := submorphs
+ 		detect: [:ea | ea hasProperty: #titleString]
+ 		ifNone: [^self].
+ 	(titleMorph fullContainsPoint: evt position) ifTrue: [evt hand grabMorph: self]!
- 	"Grab the menu and drag it to some other place"
- 	evt hand grabMorph: self.!

More information about the Squeak-dev mailing list