[squeak-dev] The Inbox: Morphic-kfr.722.mcz

Chris Muller asqueaker at gmail.com
Mon Jun 23 15:18:09 UTC 2014


Can you explain what effect this has for regular interaction with an
image?  It's not obvious to me.

On Sun, Jun 22, 2014 at 10:04 AM,  <commits at source.squeak.org> wrote:
> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-kfr.722.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-kfr.722
> Author: kfr
> Time: 22 June 2014, 4:59:39.758 pm
> UUID: fffb2b9e-3b71-f341-9042-4e35e7cc19fa
> Ancestors: Morphic-cmm.721
>
> Make keyboard focus respect Preferences mouseOverForKeyboardFocus. With this change one has to click for keyboard fokus.
>
> =============== Diff against Morphic-cmm.721 ===============
>
> Item was changed:
>   ----- Method: PluggableListMorph>>mouseUp: (in category 'events') -----
>   mouseUp: event
>         "The mouse came up within the list; take appropriate action"
>         | row |
>         row := self rowAtLocation: event position.
>         "aMorph ifNotNil: [aMorph highlightForMouseDown: false]."
>         model okToChange
>                 ifFalse: [^ self].
>         "No change if model is locked"
>         row = self selectionIndex
>                 ifTrue: [(autoDeselect ifNil: [true]) ifTrue:[row = 0 ifFalse: [self changeModelSelection: 0] ]]
>                 ifFalse: [self changeModelSelection: (self modelIndexFor: row)].
> +       event hand newKeyboardFocus: self.
> +       hasFocus := true.
>         Cursor normal show!
>
> Item was changed:
>   ----- Method: ScrollPane>>handlesMouseOver: (in category 'event handling') -----
>   handlesMouseOver: evt
>         "Could just ^ true, but this ensures that scroll bars won't flop out
>         if you mouse-over appendages such as connecting pins."
>         self flag: #arNote. "I have no idea how the code below could've ever worked. If the receiver does not handle mouse over events then it should not receive any #mouseLeave if the mouse leaves the receiver for real. This is because 'evt cursorPoint' describes the *end* point of the movement and considering that the code would return false if the move ends outside the receiver the scroll bars should never pop back in again. Which is exactly what happens with the new event logic if you don't just ^true. I'm leaving the code in for reference - perhaps somebody can make sense from it; I sure cannot."
> +  ^Preferences mouseOverForKeyboardFocus
> -       ^true
>   "
>         | cp |
>         cp := evt cursorPoint.
>         (bounds containsPoint: cp)
>                 ifTrue: [^ true]
>                 ifFalse: [self submorphsDo:
>                                         [:m | (m containsPoint: cp) ifTrue:
>                                                         [m == scrollBar
>                                                                 ifTrue: [^ true]
>                                                                 ifFalse: [^ false]]].
>                                 ^ false]
>   "!
>
>


More information about the Squeak-dev mailing list