The Trunk: Morphic-cmm.1123.mcz

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

The Trunk: Morphic-cmm.1123.mcz

commits-2
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.1123.mcz

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

Name: Morphic-cmm.1123
Author: cmm
Time: 27 April 2016, 1:22:50.860329 pm
UUID: cecf8344-3af9-4811-a7da-39bb25d305d1
Ancestors: Morphic-cmm.1116, Morphic-bf.1122

Merge cmm.1116.

=============== Diff against Morphic-bf.1122 ===============

Item was changed:
  ----- Method: AlternatePluggableListMorphOfMany>>mouseMove: (in category 'event handling') -----
  mouseMove: event
  "The mouse has moved, as characterized by the event provided.  Adjust the scrollbar, and alter the selection as appropriate"
 
  | oldIndex oldVal row |
  event position y < self top
  ifTrue:
  [scrollBar scrollUp: 1.
  row := self rowAtLocation: scroller topLeft + (1 @ 1)]
  ifFalse:
  [row := event position y > self bottom
  ifTrue:
  [scrollBar scrollDown: 1.
  self rowAtLocation: scroller bottomLeft + (1 @ -1)]
  ifFalse: [ self rowAtLocation: event position]].
  row = 0 ifTrue: [^super mouseDown: event].
 
  model okToChange ifFalse: [^self]. "No change if model is locked"
 
  "Set meaning for subsequent dragging of selection"
  oldIndex := self getCurrentSelectionIndex.
  oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt: oldIndex].
  "Need to restore the old one, due to how model works, and set new one."
  oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put: oldVal].
 
  "Inform model of selected item and let it toggle."
  self
  changeModelSelection: (self modelIndexFor: row)
  shifted: true
+ controlled: true.
- controlled: event controlKeyPressed.
  submorphs do: [:each | each changed]!

Item was changed:
  ----- Method: PluggableListMorph>>charactersOccluded (in category 'geometry') -----
  charactersOccluded
  "Answer the number of characters occluded in my #visibleList by my right edge."
  | listIndex | listIndex:=0.
  ^ self visibleList
  inject: 0
  into:
  [ : sum : each | | eachString totalWidth indexOfLastVisible iconWidth |
  totalWidth:=0.
  eachString := each asString "withBlanksTrimmed".
  iconWidth := (self iconAt: (listIndex := listIndex+1)) ifNil:[0] ifNotNil: [ : icon | icon width+2 ].
  indexOfLastVisible := ((1 to: eachString size)
  detect:
  [ : stringIndex | (totalWidth:=totalWidth+(self font widthOf: (eachString at: stringIndex))) >
  (self width -
  (scrollBar
  ifNil: [ 0 ]
  ifNotNil: [ scrollBar width ]) - iconWidth) ]
  ifNone: [ eachString size + 1 ]) - 1.
+ sum + ((eachString size - indexOfLastVisible) min: 10) ]!
- sum + (eachString size - indexOfLastVisible) ]!