[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 <<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>
[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