The Inbox: Morphic-ct.1585.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Morphic-ct.1585.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1585.mcz

==================== Summary ====================

Name: Morphic-ct.1585
Author: ct
Time: 10 November 2019, 4:01:42.092559 pm
UUID: 9564d2b2-4af1-044b-96fd-532e60252fd7
Ancestors: Morphic-mt.1584

TextEditor: Don't change the cursor position after a text action has been performed. This keeps a possible selection stable after you, for example, followed a link.

=============== Diff against Morphic-mt.1584 ===============

Item was changed:
  ----- Method: TextEditor>>mouseDown: (in category 'events') -----
  mouseDown: evt
  "Either 1) handle text actions in the paragraph, 2) begin a text drag operation, or 3) modify the caret/selection."
 
  | clickPoint b |
 
  oldInterval := self selectionInterval.
  clickPoint := evt cursorPoint.
  b := paragraph characterBlockAtPoint: clickPoint.
 
  (paragraph clickAt: clickPoint for: model controller: self) ifTrue: [
- markBlock := b.
- pointBlock := b.
  evt hand releaseKeyboardFocus: morph.
  evt hand releaseMouseFocus: morph.
  ^ self ].
 
  (morph dragEnabled and: [self isEventInSelection: evt]) ifTrue: [
  evt hand
  waitForClicksOrDrag: morph
  event: evt
  selectors: {#click:. nil. nil. #startDrag:}
  threshold: HandMorph dragThreshold.
  morph setProperty: #waitingForTextDrag toValue: true.
  ^ self].
 
  evt shiftPressed
  ifFalse: [
  self closeTypeIn.
  markBlock := b.
  pointBlock := b ]
  ifTrue: [
  self closeTypeIn.
  self mouseMove: evt ].
         self storeSelectionInParagraph!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1585.mcz

marcel.taeumel
Hmm... it's also not good that markBlock and pointBlock get reset in any case. Especially since there is this "+1" offset thingy compared to selectionInterval ... 

Best,
Marcel

Am 10.11.2019 16:02:03 schrieb [hidden email] <[hidden email]>:

A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1585.mcz

==================== Summary ====================

Name: Morphic-ct.1585
Author: ct
Time: 10 November 2019, 4:01:42.092559 pm
UUID: 9564d2b2-4af1-044b-96fd-532e60252fd7
Ancestors: Morphic-mt.1584

TextEditor: Don't change the cursor position after a text action has been performed. This keeps a possible selection stable after you, for example, followed a link.

=============== Diff against Morphic-mt.1584 ===============

Item was changed:
----- Method: TextEditor>>mouseDown: (in category 'events') -----
mouseDown: evt
"Either 1) handle text actions in the paragraph, 2) begin a text drag operation, or 3) modify the caret/selection."

| clickPoint b |

oldInterval := self selectionInterval.
clickPoint := evt cursorPoint.
b := paragraph characterBlockAtPoint: clickPoint.

(paragraph clickAt: clickPoint for: model controller: self) ifTrue: [
- markBlock := b.
- pointBlock := b.
evt hand releaseKeyboardFocus: morph.
evt hand releaseMouseFocus: morph.
^ self ].

(morph dragEnabled and: [self isEventInSelection: evt]) ifTrue: [
evt hand
waitForClicksOrDrag: morph
event: evt
selectors: {#click:. nil. nil. #startDrag:}
threshold: HandMorph dragThreshold.
morph setProperty: #waitingForTextDrag toValue: true.
^ self].

evt shiftPressed
ifFalse: [
self closeTypeIn.
markBlock := b.
pointBlock := b ]
ifTrue: [
self closeTypeIn.
self mouseMove: evt ].
self storeSelectionInParagraph!




Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Morphic-ct.1585.mcz

Christoph Thiede
If I remove the assignments to markBlock and pointBlock at the end of the
method, text selection in text morphs will not work properly ...



--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

Carpe Squeak!