<body><div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        <img src="cid:b7a62068-8247-4773-8d64-e35c596cc3d5" width="auto"></img><div class="mb_sig"></div><blockquote class="history_container" type="cite" style="border-left-style:solid;border-width:1px; margin-top:20px; margin-left:0px;padding-left:10px;">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 30.09.2019 10:29:39 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">Marcel Taeumel uploaded a new version of Morphic to project The Trunk:<br>http://source.squeak.org/trunk/Morphic-mt.1548.mcz<br><br>==================== Summary ====================<br><br>Name: Morphic-mt.1548<br>Author: mt<br>Time: 30 September 2019, 10:29:19.20171 am<br>UUID: 0cf91407-3c2e-724d-b444-6986a9ca91a7<br>Ancestors: Morphic-mt.1547<br><br>Some improvements for multi-selection lists:<br>- hit [space] key to toggle selection<br>- draw the current "selection" as outline to recognize multi-selection state<br>- do not reset current "selection" to 0 when deselecting a row in the multi-selection state --- to better support keyboard navigation and [space]<br><br>=============== Diff against Morphic-mt.1547 ===============<br><br>Item was changed:<br>  ----- Method: LazyListMorph>>drawBackgroundForMulti:on: (in category 'drawing') -----<br>  drawBackgroundForMulti: row on: aCanvas <br>    "shade the background paler, if this row is selected, but not the current selected row"<br>     | selectionDrawBounds |<br>-      selectedRow = row ifTrue: [^ self].<br>   selectionDrawBounds := self drawBoundsForRow: row.<br>    selectionDrawBounds := selectionDrawBounds intersect: self bounds.<br>    aCanvas<br>               fillRectangle: selectionDrawBounds<br>            color: self multiSelectionColor!<br><br>Item was changed:<br>  ----- Method: LazyListMorph>>drawOn: (in category 'drawing') -----<br>  drawOn: aCanvas<br>  <br>      | topRow bottomRow |<br>          listItems ifEmpty: [ ^self ].<br>         <br>      self drawPreSelectionOn: aCanvas.<br>     <br>      topRow := self topVisibleRowForCanvas: aCanvas.<br>       bottomRow := self bottomVisibleRowForCanvas: aCanvas.<br>  <br>     "Draw multi-selection."<br>+    listSource hasMultiSelection ifTrue: [<br>+               topRow to: bottomRow do: [ :row |<br>+                    (listSource itemSelectedAmongMultiple: row) ifTrue: [<br>+                                self drawBackgroundForMulti: row on: aCanvas ] ] ].<br>-  topRow to: bottomRow do: [ :row |<br>-            (listSource itemSelectedAmongMultiple: row) ifTrue: [<br>-                        self drawBackgroundForMulti: row on: aCanvas ] ].<br>     self drawSelectionOn: aCanvas.<br>  <br>    "Draw hovered row if preference enabled."<br>   PluggableListMorph highlightHoveredRow ifTrue: [<br>              listSource hoverRow > 0 ifTrue: [<br>                          self highlightHoverRow: listSource hoverRow on: aCanvas ] ].<br>  <br>      "Draw all visible rows."<br>    topRow to: bottomRow do: [ :row |<br>             self display: (self item: row) atRow: row on: aCanvas ].<br>  <br>          "Finally, highlight drop row for drag/drop operations.."<br>    listSource potentialDropRow > 0 ifTrue: [<br>                  self highlightPotentialDropRow: listSource potentialDropRow on: aCanvas ].!<br><br>Item was changed:<br>  ----- Method: LazyListMorph>>drawSelectionFor:withColor:on: (in category 'drawing') -----<br>  drawSelectionFor: index withColor: color on: aCanvas<br>   <br>      | selectionDrawBounds fill |<br>          index ifNil: [ ^self ].<br>       index = 0 ifTrue: [ ^self ].<br>          selectionDrawBounds := self drawBoundsForRow: index.<br>          selectionDrawBounds := selectionDrawBounds intersect: self bounds.<br>    <br>      fill := color isColor<br>                 ifTrue: [SolidFillStyle color: color]<br>                 ifFalse: [color].<br>     fill isGradientFill ifTrue: [<br>                 fill origin: selectionDrawBounds topLeft.<br>             fill direction: 0@ selectionDrawBounds height].<br>       <br>+     listSource hasMultiSelection<br>+                 ifFalse: [aCanvas fillRectangle: selectionDrawBounds fillStyle: fill]<br>+                ifTrue: [aCanvas frameRectangle: selectionDrawBounds color: fill asColor] .!<br>-         aCanvas fillRectangle: selectionDrawBounds fillStyle: fill.!<br><br>Item was added:<br>+ ----- Method: PluggableListMorph>>hasMultiSelection (in category 'testing') -----<br>+ hasMultiSelection<br>+ <br>+  ^ false!<br><br>Item was added:<br>+ ----- Method: PluggableListMorphOfMany>>basicKeyPressed: (in category 'model access') -----<br>+ basicKeyPressed: aCharacter<br>+ <br>+  aCharacter = Character space<br>+                 ifTrue: [self specialKeyPressed: aCharacter asciiValue]<br>+              ifFalse: [super basicKeyPressed: aCharacter].!<br><br>Item was added:<br>+ ----- Method: PluggableListMorphOfMany>>hasMultiSelection (in category 'testing') -----<br>+ hasMultiSelection<br>+ <br>+  ^ true!<br><br>Item was changed:<br>  ----- Method: PluggableListMorphOfMany>>mouseDown: (in category 'event handling') -----<br>  mouseDown: event<br>+    | row index |<br>-        | oldIndex oldVal row index |<br>         event yellowButtonPressed ifTrue: [^ self yellowButtonActivity: event shiftPressed].<br>          row := self rowAtLocation: event position.<br>  <br>        row = 0 ifTrue: [^super mouseDown: event].<br>    index := self modelIndexFor: row.<br>  <br>         model okToChange ifFalse: [^ self].  "No change if model is locked"<br>  <br>+    self changeModelSelection: index.<br>-    "Set meaning for subsequent dragging of selection"<br>-         dragOnOrOff := (self listSelectionAt: index) not.<br>-    oldIndex := self getCurrentSelectionIndex.<br>-   oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt: oldIndex].<br>  <br>+        "Set meaning for subsequent dragging of selection"<br>+         self<br>+                 listSelectionAt: index<br>+               put: (dragOnOrOff := (self listSelectionAt: index) not)<br>-      "Set or clear new primary selection (listIndex)"<br>-   dragOnOrOff<br>-          ifTrue: [self changeModelSelection: index]<br>-           ifFalse: [self changeModelSelection: 0].<br>- <br>-         "Need to restore the old one, due to how model works, and set new one."<br>-    oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put: oldVal].<br>-  self listSelectionAt: index put: dragOnOrOff.<br>-        "event hand releaseMouseFocus: aMorph."<br>  !<br><br>Item was changed:<br>  ----- Method: PluggableListMorphOfMany>>mouseMove: (in category 'event handling') -----<br>  mouseMove: event <br>     "The mouse has moved, as characterized by the event provided.  Adjust the scrollbar, and alter the selection as appropriate"<br>  <br>+   | row index |<br>-        | oldIndex oldVal row index |<br>         event position y < self="" top=""><br>                  ifTrue: <br>                      [scrollBar scrollUp: 1.<br>                       row := self rowAtLocation: scroller topLeft + (1 @ 1)]<br>                ifFalse: <br>                     [row := event position y > self bottom <br>                            ifTrue: <br>                                      [scrollBar scrollDown: 1.<br>                                     self rowAtLocation: scroller bottomLeft + (1 @ -1)]<br>                           ifFalse: [ self rowAtLocation: event position]].<br>      row = 0 ifTrue: [^super mouseDown: event].<br>    index := self modelIndexFor: row.<br>  <br>         model okToChange ifFalse: [^self].      "No change if model is locked"<br>  <br>+         dragOnOrOff ifNil: [<br>+                 "Was not set at mouse down, which means the mouse must have gone down in an area where there was no list item"<br>+             dragOnOrOff := (self listSelectionAt: index) not].<br>-   dragOnOrOff ifNil: <br>-                  ["Was not set at mouse down, which means the mouse must have gone down in an area where there was no list item"<br>-                    dragOnOrOff := (self listSelectionAt: index) not].<br>  <br>+       self changeModelSelection: index.<br>+    self listSelectionAt: index put: dragOnOrOff.!<br>-       "Set meaning for subsequent dragging of selection"<br>-         oldIndex := self getCurrentSelectionIndex.<br>-   oldIndex ~= 0 ifTrue: [oldVal := self listSelectionAt: oldIndex].<br>- <br>-        "Set or clear new primary selection (listIndex)"<br>-   dragOnOrOff <br>-                 ifTrue: [self changeModelSelection: index]<br>-           ifFalse: [self changeModelSelection: 0].<br>- <br>-         "Need to restore the old one, due to how model works, and set new one."<br>-    oldIndex ~= 0 ifTrue: [self listSelectionAt: oldIndex put: oldVal].<br>-  self listSelectionAt: index put: dragOnOrOff.<br>- !<br><br>Item was added:<br>+ ----- Method: PluggableListMorphOfMany>>specialKeyPressed: (in category 'model access') -----<br>+ specialKeyPressed: asciiValue<br>+ <br>+    asciiValue = Character space asciiValue<br>+              ifTrue: [ | index |<br>+                  index :=  self getCurrentSelectionIndex.<br>+                     self<br>+                                 listSelectionAt: index<br>+                               put: ((self listSelectionAt: index) not).<br>+                    ^ self].<br>+             <br>+     super specialKeyPressed: asciiValue.!<br><br><br></div></blockquote>
                                        </div></body>