tawasuyu

tawasuyu/llimphi

Sovereign retained-mode GPU UI framework in Rust (wgpu+vello+taffy+parley), Elm loop, 40+ widgets.

Rust 124Markdown 82TOML 78Shell 12149 Sutichaykuna

⎇ c5a232cf24788ab75a850ffe81eca5a7af50e2f8 widgets/edit-menu/README.md Markdown · 37 siq'ikuna · 1.3 KB Ñawpa willay ch'uya

chore: refresco desde el monorepo — 27 crates nuevos (anim, lottie, svg, mesh, image, layer, test, wire-view, widgets rag-sidebar/router/lazy-list/rive-button) y sync de los 95 existentes 93253cc22 · Sergio ·

1# llimphi-widget-edit-menu
2
3The standard edit menu for any Llimphi text field.
4
5Both the single-line input (`llimphi_widget_text_input`) and the rich IDE editor
6(`llimphi_widget_text_editor`) build on the same `EditorState`. From that state
7this widget assembles the canonical context menu:
8
9```text
10  ┃ EDIT
11  ┃ Undo                Ctrl+Z
12  ┃ Redo                Ctrl+Y
13  ┃ ─────────────────────
14  ┃ Cut                 Ctrl+X
15  ┃ Copy                Ctrl+C
16  ┃ Paste               Ctrl+V
17  ┃ Delete              Del
18  ┃ ─────────────────────
19  ┃ Select all          Ctrl+A
20```
21
22Every item is enabled or not according to the real state (no selection →
23Cut/Copy/Delete greyed; no history → Undo greyed; and so on).
24
25Typical use, in three steps per app:
26
271. The field emits the right-click position — `View::on_right_click_at` →
28   `Msg::OpenEditMenu(x, y)`. The `update` stores the anchor.
292. `App::view_overlay` returns
30   `Some(context_menu_view(edit_menu::edit_context_menu(...)))` while the anchor
31   is present.
323. The pick produces `Msg::Edit(EditAction)`; the `update` calls `apply` with the
33   focused field's `EditorState` and the clipboard.
34
35---
36
37Part of **llimphi** — see [llimphi](../../README.md).

README.md

llimphi-widget-edit-menu

The standard edit menu for any Llimphi text field.

Both the single-line input (llimphi_widget_text_input) and the rich IDE editor (llimphi_widget_text_editor) build on the same EditorState. From that state this widget assembles the canonical context menu:

  ┃ EDIT
  ┃ Undo                Ctrl+Z
  ┃ Redo                Ctrl+Y
  ┃ ─────────────────────
  ┃ Cut                 Ctrl+X
  ┃ Copy                Ctrl+C
  ┃ Paste               Ctrl+V
  ┃ Delete              Del
  ┃ ─────────────────────
  ┃ Select all          Ctrl+A

Every item is enabled or not according to the real state (no selection → Cut/Copy/Delete greyed; no history → Undo greyed; and so on).

Typical use, in three steps per app:

  1. The field emits the right-click position — View::on_right_click_at → Msg::OpenEditMenu(x, y). The update stores the anchor.
  2. App::view_overlay returns Some(context_menu_view(edit_menu::edit_context_menu(...))) while the anchor is present.
  3. The pick produces Msg::Edit(EditAction); the update calls apply with the focused field's EditorState and the clipboard.

Part of llimphi — see llimphi.