diff options
| author | eunhhu <[email protected]> | 2026-09-26 11:33:31 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-26 11:33:31 +0100 |
| commit | 0d5effd6afe8808296a01db102ca4c247cdcd1af (patch) | |
| tree | 4f1113880606fb6dda861fd846f8ff40d5c17a63 /src/main.c | |
| parent | 3b3e4a221fa47d0109c6ab99be65b5ba48bae254 (diff) | |
| download | vega-0d5effd6afe8808296a01db102ca4c247cdcd1af.tar.gz vega-0d5effd6afe8808296a01db102ca4c247cdcd1af.zip | |
Show filtered lists and their shared focus
A list may now be filtered (each t in tasks where !t.done), and several
filtered lists over one list share one focus: the focus view names an
item, so Vega asks Pure which row shows it and highlights it only in the
list that holds it; the other lists have no focus (null in the web
surface's JSON, and the spoken surface names the item where it is). A
click or point on a row points at the item that row shows, and the wheel
on a list without the focus focuses the row under it. Pure's rows now
take a mutable app.
examples/today.aup shows what is open and what is done; its CLI output
matches a model over random adds, moves, toggles and points into either
list, and the web surface leaves the other list without a focus.
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -95,8 +95,10 @@ static bool mouse(unsigned button, unsigned line) { const VegaPart *part = &screen.parts[index]; if (button == 64 || button == 65) { size_t focus = vega_focus(&app, part), rows = vega_rows(&app, part); - if (button == 64 ? !focus : focus + 1 >= rows) return false; - item = button == 64 ? focus - 1 : focus + 1; + if (focus < rows) { /* else the wheel focuses the row under it */ + if (button == 64 ? !focus : focus + 1 >= rows) return false; + item = button == 64 ? focus - 1 : focus + 1; + } } else if (button) return false; return vega_point(&app, part, item); } |
