add(examples/elements): mouse clickable button
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 39s

This commit is contained in:
2025-02-21 14:50:29 +01:00
parent b980703350
commit 8fbc958ca1
4 changed files with 122 additions and 5 deletions

View File

@@ -56,13 +56,14 @@ pub const InputField = struct {
const row: u16 = 1;
const col: u16 = 1;
const anchor = (row * size.cols) + col;
for (this.input.items, 0..) |cp, idx| {
cells[(row * size.cols) + col + idx].style.fg = .black;
cells[(row * size.cols) + col + idx].cp = cp;
cells[anchor + idx].style.fg = .black;
cells[anchor + idx].cp = cp;
// NOTE: do not write over the contents of this `Container`'s `Size`
if ((row * size.cols) + col + idx == cells.len - 1) break;
if (anchor + idx == cells.len - 1) break;
}
}
};