[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squeak-dev
Subject:    Re: [squeak-dev] The Trunk: Morphic-cmm.1463.mcz
From:       karl ramberg <karlramberg () gmail ! com>
Date:       2018-09-14 16:27:02
Message-ID: CAGzzWLgB6jwX6agXavHeYPjEeCfSwn2c6SaeVxs93FupPRzo=w () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Nice, halo activation works again :-D

Best,
Karl

On Fri, Sep 7, 2018 at 9:38 PM <commits@source.squeak.org> wrote:

> Chris Muller uploaded a new version of Morphic to project The Trunk:
> http://source.squeak.org/trunk/Morphic-cmm.1463.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-cmm.1463
> Author: cmm
> Time: 7 September 2018, 2:37:21.377647 pm
> UUID: c11ac7b7-0b5b-4814-87d3-9c8eb2b62bce
> Ancestors: Morphic-cmm.1462
>
> - Fix halo-invocation on a rotated Morph when halos are on the World.
> - Provide access to the TextIndent attribute on the alignment menu.
> - Fix a NonBooleanReceiver error that appeared when pressing backspace on
> a read-only text field.
>
> =============== Diff against Morphic-cmm.1462 ===============
>
> Item was changed:
>   ----- Method: PasteUpMorph>>tryInvokeHalo: (in category
> 'events-processing') -----
>   tryInvokeHalo: aUserInputEvent
>         "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."
>         | stack innermost haloTarget |
>         Preferences noviceMode ifTrue: [ ^ self ].
>         Morph haloForAll ifFalse: [ ^ self ].
>         "the stack is the top-most morph to bottom-most."
>         stack := (self morphsAt: aUserInputEvent position unlocked: true)
> select:
>                 [ : each | each wantsHaloFromClick or: [ each
> handlesMouseDown: aUserInputEvent ] ].
>         innermost := aUserInputEvent hand halo
>                 ifNil: [ stack first ]
>                 ifNotNil:
>                         [ : existingHalo | stack allButFirst "existingHalo
> is first on the stack, not a target"
>                                 detect: [ : each | each owner == self ]
>                                 ifFound:
>                                         [ : worldContainer | "Is
> existingHalo's target part of the same worldContainer as the morph clicked?"
>                                         (existingHalo target withAllOwners
> includes: worldContainer)
> +                                               ifTrue: [ "same hierarchy,
> let #transferHalo: continue to handle it for now."  ^self ]
> -                                               ifTrue: [ "same hierarchy,
> let #transferHalo: continue to handle it for now."  ^ self ]
>                                                 ifFalse:
>                                                         [ "different
> hierarchy, remove + add."
>                                                         aUserInputEvent
> hand removeHalo.
>                                                         aUserInputEvent
> shiftPressed
>                                                                 ifTrue: [
> stack second "first is still the just removed halo" ]
>                                                                 ifFalse: [
> worldContainer ] ] ]
> +                               ifNone: [ "existingHalo is on the World,
> defer to #transferHalo: for now."  ^self ] ].
> -                               ifNone: [ "Shouldn't get here, but
> defensive code."  self ] ].
>         "If modifier key is pressed, start at innermost (the target),
> otherwise the outermost (direct child of the world (self))."
>         haloTarget  := (innermost == self or: [aUserInputEvent
> shiftPressed])
>                 ifTrue: [ innermost ]
>                 ifFalse:
>                          [ "Find the outermost owner that wants it."
>                         innermost withAllOwners reversed allButFirst
>                                 detect: [ : each | each wantsHaloFromClick
> ]
>                                 ifNone: [ "haloTarget has its own
> mouseDown handler, don't halo."  ^ self ] ].
>         "Now that we have the haloTarget, show the halo."
>         aUserInputEvent hand
>                 newMouseFocus: haloTarget
>                 event: aUserInputEvent.
>         haloTarget invokeHaloOrMove: aUserInputEvent.
>         "aUserInputEvent has been consumed, don't let it cause any further
> side-effects."
>         aUserInputEvent ignore!
>
> Item was changed:
>   ----- Method: TextEditor>>backTo: (in category 'typing support') -----
>   backTo: startIndex
>         "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."
>
> +       morph readOnly ifTrue: [^ false].
> -       morph readOnly ifTrue: [^ self].
>
>         self hasSelection ifTrue: [
>                 "Add checkpoint in undo history."
>                 self replaceSelectionWith: self nullText.
>                 ^ true].
>
>         startIndex > self text size ifTrue: [^ false].
>
>         self selectInvisiblyFrom: startIndex to: self stopIndex-1.
>
>         self isTypingIn ifTrue: [
>                 self history current type = #backward
>                         ifFalse: [self closeTypeIn]
>                         ifTrue: [
>                                 "Accumulate all deleted characters in
> current undo command."
>                                 self history current contentsBefore
> replaceFrom: 1 to: 0 with: self selection.
>                                 self history current intervalBefore in:
> [:i |
>                                         self history current
> intervalBefore: (startIndex to: i last)]]].
>
>         self openTypeInFor: #backward.
>         self zapSelectionWith: self nullText.
>
>         ^ false!
>
> Item was changed:
>   ----- Method: TextEditor>>changeAlignment (in category 'menu messages')
> -----
>   changeAlignment
> +       | options reply |
> +       options := self existingIndentation
> +               caseOf:
> +                       {[0]-> [ #('leftFlush' 'indented' 'centered'
> 'justified' 'rightFlush') ].
> +                       [1] -> [ #('leftFlush' 'indented more' 'centered'
> 'justified' 'rightFlush') ]}
> +               otherwise: [ #('leftFlush' 'indented less' 'indented more'
> 'centered' 'justified' 'rightFlush') ].
> +       reply := UIManager default chooseFrom: options values: options.
> +       reply ifNil: [ ^ self ].
> -       | aList reply  |
> -       aList := #(leftFlush centered justified rightFlush).
> -       reply := UIManager default chooseFrom: aList values: aList.
> -       reply ifNil:[^self].
>         self setAlignment: reply.
>         paragraph composeAll.
>         self recomputeSelection.
>         ^ true!
>
> Item was added:
> + ----- Method: TextEditor>>existingIndentation (in category 'private')
> -----
> + existingIndentation
> +       ^ paragraph text indentationAmountAt: (self encompassLine: self
> selectionInterval)!
>
> Item was changed:
>   ----- Method: TextEditor>>setAlignment: (in category 'menu messages')
> -----
> + setAlignment: selectionString
> +       | attr interval  |
> +       attr := selectionString
> +               caseOf:
> +                       { [ 'indented' ] -> [ TextIndent amount: 1 ].
> +                       [ 'indented more' ] -> [ TextIndent amount: self
> existingIndentation+1 ].
> +                       [ 'indented less' ] -> [  TextIndent amount: (self
> existingIndentation-1 max: 0) ]}
> +               otherwise:
> +                       [ TextAlignment perform: selectionString asSymbol
> ].
> - setAlignment: aSymbol
> -       | attr interval |
> -       attr := TextAlignment perform: aSymbol.
>         interval := self encompassLine: self selectionInterval.
> +       paragraph
> -       paragraph
>                 replaceFrom: interval first
>                 to: interval last
>                 with: ((paragraph text copyFrom: interval first to:
> interval last) addAttribute: attr)!
>
>
>

[Attachment #5 (text/html)]

<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 &lt;<a \
href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>&gt; \
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&gt;&gt;tryInvokeHalo: (in category \
&#39;events-processing&#39;) -----<br>  tryInvokeHalo: aUserInputEvent <br>
        &quot;Invoke halos around the top-most world container at \
aUserInputEvent&#39;s #position.  If it was already halo&#39;d, zero-in on its next \
inward component morph at that position.  Holding Shift during the click reverses \
this traversal order.&quot;<br>  | stack innermost haloTarget |<br>
        Preferences noviceMode ifTrue: [ ^ self ].<br>
        Morph haloForAll ifFalse: [ ^ self ].<br>
        &quot;the stack is the top-most morph to bottom-most.&quot;<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 &quot;existingHalo is \
                first on the stack, not a target&quot;<br>
                                detect: [ : each | each owner == self ]<br>
                                ifFound:<br>
                                        [ : worldContainer | &quot;Is \
existingHalo&#39;s target part of the same worldContainer as the morph \
                clicked?&quot;<br>
                                        (existingHalo target withAllOwners includes: \
worldContainer)<br> +                                               ifTrue: [ \
&quot;same hierarchy, let #transferHalo: continue to handle it for now.&quot;  ^self \
                ]<br>
-                                               ifTrue: [ &quot;same hierarchy, let \
#transferHalo: continue to handle it for now.&quot;  ^ self ]<br>  ifFalse:<br>
                                                        [ &quot;different hierarchy, \
                remove + add.&quot;<br>
                                                        aUserInputEvent hand \
                removeHalo.<br>
                                                        aUserInputEvent \
                shiftPressed<br>
                                                                ifTrue: [ stack \
                second &quot;first is still the just removed halo&quot; ]<br>
                                                                ifFalse: [ \
worldContainer ] ] ]<br> +                               ifNone: [ &quot;existingHalo \
                is on the World, defer to #transferHalo: for now.&quot;  ^self ] \
                ].<br>
-                               ifNone: [ &quot;Shouldn&#39;t get here, but defensive \
                code.&quot;  self ] ].<br>
        &quot;If modifier key is pressed, start at innermost (the target), otherwise \
                the outermost (direct child of the world (self)).&quot;<br>
        haloTarget  := (innermost == self or: [aUserInputEvent shiftPressed])<br>
                ifTrue: [ innermost ]<br>
                ifFalse:<br>
                         [ &quot;Find the outermost owner that wants it.&quot;<br>
                        innermost withAllOwners reversed allButFirst<br>
                                detect: [ : each | each wantsHaloFromClick ]<br>
                                ifNone: [ &quot;haloTarget has its own mouseDown \
handler, don&#39;t halo.&quot;  ^ self ] ].<br>  &quot;Now that we have the \
haloTarget, show the halo.&quot;<br>  aUserInputEvent hand<br>
                newMouseFocus: haloTarget<br>
                event: aUserInputEvent.<br>
        haloTarget invokeHaloOrMove: aUserInputEvent.<br>
        &quot;aUserInputEvent has been consumed, don&#39;t let it cause any further \
side-effects.&quot;<br>  aUserInputEvent ignore!<br>
<br>
Item was changed:<br>
  ----- Method: TextEditor&gt;&gt;backTo: (in category &#39;typing support&#39;) \
-----<br>  backTo: startIndex<br>
        &quot;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.&quot;<br> <br>
+       morph readOnly ifTrue: [^ false].<br>
-       morph readOnly ifTrue: [^ self].<br>
<br>
        self hasSelection ifTrue: [<br>
                &quot;Add checkpoint in undo history.&quot;<br>
                self replaceSelectionWith: self nullText.<br>
                ^ true].<br>
<br>
        startIndex &gt; 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>
                                &quot;Accumulate all deleted characters in current \
                undo command.&quot;<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&gt;&gt;changeAlignment (in category &#39;menu \
messages&#39;) -----<br>  changeAlignment<br>
+       | options reply |<br>
+       options := self existingIndentation<br>
+               caseOf:<br>
+                       {[0]-&gt; [ #(&#39;leftFlush&#39; &#39;indented&#39; \
&#39;centered&#39; &#39;justified&#39; &#39;rightFlush&#39;) ].<br> +                 \
[1] -&gt; [ #(&#39;leftFlush&#39; &#39;indented more&#39; &#39;centered&#39; \
&#39;justified&#39; &#39;rightFlush&#39;) ]}<br> +               otherwise: [ \
#(&#39;leftFlush&#39; &#39;indented less&#39; &#39;indented more&#39; \
&#39;centered&#39; &#39;justified&#39; &#39;rightFlush&#39;) ].<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&gt;&gt;existingIndentation (in category &#39;private&#39;) \
-----<br> + existingIndentation<br>
+       ^ paragraph text indentationAmountAt: (self encompassLine: self \
selectionInterval)!<br> <br>
Item was changed:<br>
  ----- Method: TextEditor&gt;&gt;setAlignment: (in category &#39;menu messages&#39;) \
-----<br> + setAlignment: selectionString<br>
+       | attr interval  |<br>
+       attr := selectionString<br>
+               caseOf: <br>
+                       { [ &#39;indented&#39; ] -&gt; [ TextIndent amount: 1 ].<br>
+                       [ &#39;indented more&#39; ] -&gt; [ TextIndent amount: self \
existingIndentation+1 ].<br> +                       [ &#39;indented less&#39; ] \
-&gt; [  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>


[Attachment #6 (text/plain)]




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic