~eliasnaur/gio

ref: 284659d3eac9 gio/widget d---------
a8a48bb8 — vsariola 3 months ago
widget: fix bug how f.pos is calculated in widget.Float

The order of subtraction when calculating f.pos from value was wrong,
so setting a minimum value for a Float never really worked, although
min = 0 worked as intended which is why this probably went unnoticed.

Signed-off-by: vsariola <5684185+vsariola@users.noreply.github.com>
widget/material: use more readable editor default selection color

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
Programmatic Click function

Signed-off-by: Paulo Melo <paulo.durrer.melo@gmail.com>
widget: fix Editor panic

If you created an Editor and immediately SetCaret, it panicked because
e.lines was nil and it looked at e.lines[0].

- Add e.makeValid at the top of SetCaret.
- Add a test case for this situation.

Signed-off-by: Larry Clapp <larry@theclapp.org>
widget,widget/material: add selection to the editor

- Allow dragging to be on both horizontal and vertical axes at once.
- Split Editor.caret.pos into caret.start and caret.stop. caret.start is
  the old caret.pos, and is both the position of the caret, and also the
  start of selected text. caret.end is the end of the selected text.
  Start can be after end, e.g. after after Shift-DownArrow.
- Update caret.end after a mouse drag, and various shifted keys
  (Shift-UpArrow, Shift-DownArrow, etc).
- Change Shortcut-C to copy only the selected text, not the whole editor
  text.
- Add Shortcut-X to copy and delete selected text, and Shortcut-A to
  select all text.
- The various Insert/Delete/etc functions now overwrite or delete the
  selection, as appropriate.
- Change MoveCaret to accept a distance for selection end, as well.
  Change SetCaret to accept a selection end offset.
- Add SelectionLen to get the selection length, Selection to get
  selection offsets, SelectedText to get the selected text, and
  ClearSelection to clear the selection.
- Add a rudimentary selection unit test, and extend the deleteWord unit
  test with some text selection cases.
- Add SelectionColor to material.EditorStyle, which defaults to
  Theme.Palette.ContrastBg.

Signed-off-by: Larry Clapp <larry@theclapp.org>
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>
io/router: rename Router.Add to the more specific Queue

Signed-off-by: Elias Naur <mail@eliasnaur.com>
io/router/key: add explicit tag to FocusOp; make last SoftKeyboardOp apply

The target of FocusOp is too subtle; be explicit instead and remove
any doubt.

Multiple SoftKeyboardOp in a single frame is rare, but if they do occur,
they should behave as if they were from separate frames: the last one
applies.

As a side-effect the key event router can be much simplified.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
widget/material: use clip.UniformRRect

Signed-off-by: pierre <pierre.curto@gmail.com>
widget: make border draw within widget dims as documented

Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
widget/material: add hover to Switch

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
widget/material: add hovered to RadioButton

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
widget/material: add hover to CheckBox

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
widget/material: add hover to Button

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
gesture,widget: add hovered property

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
widget/material: added support for Vertical axis to Slider

Adding an axis to the Float widget, allows positioning the Slider one not only horizontally but also vertically.
Also update the fill ops while there.

Signed-off-by: pierre <pierre.curto@gmail.com>
op: rename StackOp/Push/Pop to StateOp/Save/Load

The semantics were relaxed in a previous commit; this change renames
to operations accordingly.

API change. Use gofmt to adjust your code accordingly:

gofmt -r 'op.Push(a).Pop() -> op.Save(a).Load()'
gofmt -r 'op.Push(a) -> op.Save(a)'
gofmt -r 'v.Pop() -> v.Load()'
gofmt -r 'op.StackOp -> op.StateOp'

Signed-off-by: Elias Naur <mail@eliasnaur.com>
widget: use correct color in Icon

iconvg seems to expect a linear premultiplied color.

Fixes gio#132

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
widget/material: updated Switch comments.

Signed-off-by: pierre <pierre.curto@gmail.com>
fd2d96ad — Walter Werner SCHNEIDER 4 months ago
all: fix spelling errors

Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Signed-off-by: Elias Naur <mail@eliasnaur.com>
83d23ab5 — Walter Werner SCHNEIDER 4 months ago
all: sort and group imports

Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
Next