[Pkg] The Trunk: Morphic-mt.1027.mcz
commits at source.squeak.org
commits at source.squeak.org
Thu Nov 5 08:08:43 UTC 2015
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1027.mcz
==================== Summary ====================
Name: Morphic-mt.1027
Author: mt
Time: 5 November 2015, 9:08:06.974 am
UUID: aaa21de5-cebc-4dcf-bf58-8595ba22ee71
Ancestors: Morphic-mt.1026
In lists, update selection before starting drag operation in case the user decides not to drag a not selected item.
=============== Diff against Morphic-mt.1026 ===============
Item was changed:
----- Method: PluggableListMorph>>startDrag: (in category 'drag and drop') -----
startDrag: evt
+ | item itemMorph |
- | item itemMorph |
evt hand hasSubmorphs ifTrue: [^ self].
self model okToChange ifFalse: [^ self].
+ "Ensure selection to save additional click."
+ (self modelIndexFor: (self rowAtLocation: evt position)) in: [:evtIndex |
+ self selectionIndex = evtIndex ifFalse: [self changeModelSelection: evtIndex]].
+
item := self selection ifNil: [^ self].
itemMorph := StringMorph contents: item asStringOrText.
[ "Initiate drag."
(self model dragPassengerFor: itemMorph inMorph: self) ifNotNil: [:passenger | | ddm |
ddm := (self valueOfProperty: #dragTransferClass ifAbsent: [TransferMorph]) withPassenger: passenger from: self.
ddm dragTransferType: (self model dragTransferTypeForMorph: self).
ddm updateFromUserInputEvent: evt.
self model dragStartedFor: itemMorph transferMorph: ddm.
evt hand grabMorph: ddm]
] ensure: [
Cursor normal show.
evt hand releaseMouseFocus: self].!
More information about the Packages
mailing list