Skip to main content

Crate day_piece_searchfield

Crate day_piece_searchfield 

Source
Expand description

day-piece-searchfield — an EXTERNAL Day Piece (DESIGN.md §15): a NATIVE search input realized as a distinct search control per toolkit (NSSearchField / UISearchTextField / GtkSearchEntry / a QLineEdit search shim / an EditText styled for search / a XAML AutoSuggestBox), registered link-time into each backend’s renderer slice without touching day.

It is bound two-way to a Signal<String> — the same pattern as day-piece-picker: a native edit dispatches an Event::TextChanged back to Rust which sets the signal, and an external signal change patches the control with SearchPatch::SetText. A per-build echo guard remembers the last value that arrived FROM the native control so its own change is not written straight back (which some toolkits would re-emit → a feedback loop). Like day-core’s text_field it is a width-growing leaf (grow_w = true, natural height): a search field fills its row.

let query = Signal::new(String::new());
search_field(query).placeholder("Search fruit…")

Structs§

SearchField
A native search field bound two-way to query. Set a prompt with .placeholder(_).
SearchProps
Full props (realize). text seeds the control; placeholder is the empty-state prompt. Only text changes after build (via SearchPatch::SetText); the placeholder is fixed at build.

Enums§

SearchPatch
The single imperative update: replace the control’s text (programmatic sync from the signal).

Constants§

KIND

Functions§

search_field
search_field(query) — a native search input whose text mirrors query in both directions.
Day API ↩ Guides· daybrite.dev