gpui-kit GitHub

Components

TimeInput view

A segmented time field over the host's own clock.

A view survives a frame. Hold it in an Entity with cx.new(..) and reach it with .update(..).

use gpui_kit::datetime::TimeInput;

Construct

new(ident: impl Into<Ident>, adapter: SharedDateAdapter, _window: &mut Window, cx: &mut Context<Self>) -> Self

Options

Chain onto the value.

value(value: TimeOfDay) -> Self
seconds(seconds: bool) -> Self

Commands

Need a Context, so they need a view.

set_value(value: TimeOfDay, cx: &mut Context<Self>)
set_disabled(disabled: bool, cx: &mut Context<Self>)

Queries

Only answer; they change nothing.

current() -> TimeOfDay
active_segment() -> Segment
clock() -> Clock

Reports

The variants of the event it emits. It never applies the change itself.

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/datetime/time_input.rs