<div dir="ltr">Nice, halo activation works again :-D<div><br></div><div>Best,</div><div>Karl</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 7, 2018 at 9:38 PM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Chris Muller uploaded a new version of Morphic to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Morphic-cmm.1463.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Morphic-cmm.1463.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-cmm.1463<br>
Author: cmm<br>
Time: 7 September 2018, 2:37:21.377647 pm<br>
UUID: c11ac7b7-0b5b-4814-87d3-9c8eb2b62bce<br>
Ancestors: Morphic-cmm.1462<br>
<br>
- Fix halo-invocation on a rotated Morph when halos are on the World.<br>
- Provide access to the TextIndent attribute on the alignment menu.<br>
- Fix a NonBooleanReceiver error that appeared when pressing backspace on a read-only text field.<br>
<br>
=============== Diff against Morphic-cmm.1462 ===============<br>
<br>
Item was changed:<br>
  ----- Method: PasteUpMorph>>tryInvokeHalo: (in category 'events-processing') -----<br>
  tryInvokeHalo: aUserInputEvent <br>
        "Invoke halos around the top-most world container at aUserInputEvent's #position.  If it was already halo'd, zero-in on its next inward component morph at that position.  Holding Shift during the click reverses this traversal order."<br>
        | stack innermost haloTarget |<br>
        Preferences noviceMode ifTrue: [ ^ self ].<br>
        Morph haloForAll ifFalse: [ ^ self ].<br>
        "the stack is the top-most morph to bottom-most."<br>
        stack := (self morphsAt: aUserInputEvent position unlocked: true) select:<br>
                [ : each | each wantsHaloFromClick or: [ each handlesMouseDown: aUserInputEvent ] ].<br>
        innermost := aUserInputEvent hand halo<br>
                ifNil: [ stack first ]<br>
                ifNotNil:<br>
                        [ : existingHalo | stack allButFirst "existingHalo is first on the stack, not a target"<br>
                                detect: [ : each | each owner == self ]<br>
                                ifFound:<br>
                                        [ : worldContainer | "Is existingHalo's target part of the same worldContainer as the morph clicked?"<br>
                                        (existingHalo target withAllOwners includes: worldContainer)<br>
+                                               ifTrue: [ "same hierarchy, let #transferHalo: continue to handle it for now."  ^self ]<br>
-                                               ifTrue: [ "same hierarchy, let #transferHalo: continue to handle it for now."  ^ self ]<br>
                                                ifFalse:<br>
                                                        [ "different hierarchy, remove + add."<br>
                                                        aUserInputEvent hand removeHalo.<br>
                                                        aUserInputEvent shiftPressed<br>
                                                                ifTrue: [ stack second "first is still the just removed halo" ]<br>
                                                                ifFalse: [ worldContainer ] ] ]<br>
+                               ifNone: [ "existingHalo is on the World, defer to #transferHalo: for now."  ^self ] ].<br>
-                               ifNone: [ "Shouldn't get here, but defensive code."  self ] ].<br>
        "If modifier key is pressed, start at innermost (the target), otherwise the outermost (direct child of the world (self))."<br>
        haloTarget  := (innermost == self or: [aUserInputEvent shiftPressed])<br>
                ifTrue: [ innermost ]<br>
                ifFalse:<br>
                         [ "Find the outermost owner that wants it."<br>
                        innermost withAllOwners reversed allButFirst<br>
                                detect: [ : each | each wantsHaloFromClick ]<br>
                                ifNone: [ "haloTarget has its own mouseDown handler, don't halo."  ^ self ] ].<br>
        "Now that we have the haloTarget, show the halo."<br>
        aUserInputEvent hand<br>
                newMouseFocus: haloTarget<br>
                event: aUserInputEvent.<br>
        haloTarget invokeHaloOrMove: aUserInputEvent.<br>
        "aUserInputEvent has been consumed, don't let it cause any further side-effects."<br>
        aUserInputEvent ignore!<br>
<br>
Item was changed:<br>
  ----- Method: TextEditor>>backTo: (in category 'typing support') -----<br>
  backTo: startIndex<br>
        "During typing, backspace to startIndex. If there already is a selection, just delete that selection. Otherwise, check if we did something else than backward-deletion and start a new command if so."<br>
<br>
+       morph readOnly ifTrue: [^ false].<br>
-       morph readOnly ifTrue: [^ self].<br>
<br>
        self hasSelection ifTrue: [<br>
                "Add checkpoint in undo history."<br>
                self replaceSelectionWith: self nullText.<br>
                ^ true].<br>
<br>
        startIndex > self text size ifTrue: [^ false].<br>
<br>
        self selectInvisiblyFrom: startIndex to: self stopIndex-1.<br>
<br>
        self isTypingIn ifTrue: [<br>
                self history current type = #backward<br>
                        ifFalse: [self closeTypeIn]<br>
                        ifTrue: [<br>
                                "Accumulate all deleted characters in current undo command."<br>
                                self history current contentsBefore replaceFrom: 1 to: 0 with: self selection.<br>
                                self history current intervalBefore in: [:i |<br>
                                        self history current intervalBefore: (startIndex to: i last)]]].<br>
<br>
        self openTypeInFor: #backward.<br>
        self zapSelectionWith: self nullText.<br>
<br>
        ^ false!<br>
<br>
Item was changed:<br>
  ----- Method: TextEditor>>changeAlignment (in category 'menu messages') -----<br>
  changeAlignment<br>
+       | options reply |<br>
+       options := self existingIndentation<br>
+               caseOf:<br>
+                       {[0]-> [ #('leftFlush' 'indented' 'centered' 'justified' 'rightFlush') ].<br>
+                       [1] -> [ #('leftFlush' 'indented more' 'centered' 'justified' 'rightFlush') ]}<br>
+               otherwise: [ #('leftFlush' 'indented less' 'indented more' 'centered' 'justified' 'rightFlush') ].<br>
+       reply := UIManager default chooseFrom: options values: options.<br>
+       reply ifNil: [ ^ self ].<br>
-       | aList reply  |<br>
-       aList := #(leftFlush centered justified rightFlush).<br>
-       reply := UIManager default chooseFrom: aList values: aList.<br>
-       reply ifNil:[^self].<br>
        self setAlignment: reply.<br>
        paragraph composeAll.<br>
        self recomputeSelection.<br>
        ^ true!<br>
<br>
Item was added:<br>
+ ----- Method: TextEditor>>existingIndentation (in category 'private') -----<br>
+ existingIndentation<br>
+       ^ paragraph text indentationAmountAt: (self encompassLine: self selectionInterval)!<br>
<br>
Item was changed:<br>
  ----- Method: TextEditor>>setAlignment: (in category 'menu messages') -----<br>
+ setAlignment: selectionString<br>
+       | attr interval  |<br>
+       attr := selectionString<br>
+               caseOf: <br>
+                       { [ 'indented' ] -> [ TextIndent amount: 1 ].<br>
+                       [ 'indented more' ] -> [ TextIndent amount: self existingIndentation+1 ].<br>
+                       [ 'indented less' ] -> [  TextIndent amount: (self existingIndentation-1 max: 0) ]}<br>
+               otherwise:<br>
+                       [ TextAlignment perform: selectionString asSymbol ].<br>
- setAlignment: aSymbol<br>
-       | attr interval |<br>
-       attr := TextAlignment perform: aSymbol.<br>
        interval := self encompassLine: self selectionInterval.<br>
+       paragraph<br>
-       paragraph <br>
                replaceFrom: interval first <br>
                to: interval last <br>
                with: ((paragraph text copyFrom: interval first to: interval last) addAttribute: attr)!<br>
<br>
<br>
</blockquote></div>