~eliasnaur/gio

ref: 284659d3eac9 gio/widget/buffer.go -rw-r--r-- 3.6 KiB
widget: refactoring to prep for editor selection

- Move caret from editBuffer.caret to Editor.caret.pos.ofs and related
  refactoring. Move other fields in Editor.caret into Editor.caret.pos.
- Refactor several functions to change a position passed into them,
  rather than changing e.rr.caret directly.
- Add editBuffer.Seek().
- Remove editBuffer.dump().
- Change Editor.Move to MoveCaret.
- Add Editor.SetCaret.
- Updated tests.

Signed-off-by: Larry Clapp <larry@theclapp.org>
widget: maintain Editor caret position

Only call layoutCaret when the text layout changes, adjust position
for caret movement.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
widget: fix caret comparison in editBuffer.move

Signed-off-by: Elias Naur <mail@eliasnaur.com>
text: add io.Reader Layout method to Shaper

use them for Editor, which is no longer required to construct a string
for laying out its content.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
widget: add some rudimentary exported editing methods

Editor.Delete
Editor.Move
Editor.Insert

Move the Editor.command method up above all the functions it calls.

Signed-off-by: Larry Clapp <larry@theclapp.org>
widget,text: move Label and Editor from text to widget package

Signed-off-by: Elias Naur <mail@eliasnaur.com>
text: fix editBuffer.runeBefore

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: rename the gioui.org/ui module to gioui.org

The "ui" is redundant and stutters.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
ui/text: add ChangeEvent and rename Submit to SubmitEvent

Signed-off-by: Elias Naur <mail@eliasnaur.com>
all: initial import

Signed-off-by: Elias Naur <mail@eliasnaur.com>