The Trunk: ToolBuilder-Morphic-mt.152.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ToolBuilder-Morphic-mt.152.mcz

commits-2
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.152.mcz

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

Name: ToolBuilder-Morphic-mt.152
Author: mt
Time: 5 November 2015, 9:06:46.563 am
UUID: 7149e466-016d-46b7-b3c7-426363a3a749
Ancestors: ToolBuilder-Morphic-mt.151

In lists, update selection before starting drag operation in case the user decides not to drag a not selected item.

=============== Diff against ToolBuilder-Morphic-mt.151 ===============

Item was changed:
  ----- Method: PluggableListMorphPlus>>startDrag: (in category 'drag and drop') -----
  startDrag: evt
 
  | item itemMorph modelIndex |
  dragItemSelector ifNil:[^self].
  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.
  modelIndex := self modelIndexFor: self selectionIndex.
 
  [ "Initiate drag."
  (self model perform: dragItemSelector with: modelIndex) ifNotNil: [:passenger | | ddm |
  ddm := (self valueOfProperty: #dragTransferClass ifAbsent: [TransferMorph]) withPassenger: passenger from: self.
  ddm dragTransferType: (self dragTypeSelector ifNotNil: [:s | self model perform: s with: modelIndex]).
  ddm updateFromUserInputEvent: evt.
  self dragStartedSelector ifNotNil: [:s | self model perform: s with: itemMorph with: ddm].
  evt hand grabMorph: ddm].
  ] ensure: [
  Cursor normal show.
  evt hand releaseMouseFocus: self]!